在不重启微服务的情况 下更新配置如何来实现呢? 我们使用SpringCloudBus来实现配置的自动更新。 引入依赖 <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring‐cloud‐bus</art ...
分类:
数据库 时间:
2020-03-26 12:32:02
阅读次数:
83
说明:开发的时候打开热部署,项目上线的时候一定要关闭热部署 1.添加devtools依赖,写在本模块中 <!--般为通用配置--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-dev ...
分类:
其他好文 时间:
2020-03-25 23:10:48
阅读次数:
55
一、解决跨域、过虑options请求问题 1.创建过虑类 import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; import javax.se ...
分类:
编程语言 时间:
2020-03-25 01:25:08
阅读次数:
109
环境: SpringFramework:4.3.5.RELEASE apollo-client:1.5.1 1.在项目的 resources/META-INF/ 目录下添加 app.properties 文件: #Apollo配置id app.id = phpdragon-demo apollo.b ...
分类:
编程语言 时间:
2020-03-24 23:04:39
阅读次数:
78
AntPathMatcher通配符规则 官方文档:https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/util/AntPathMatcher.html 官方示例: The mappi ...
分类:
其他好文 时间:
2020-03-24 15:49:44
阅读次数:
474
因springboot框架通常用于前后端分离项目,需配置后台允许跨域访问,配置类如下,将该类加入工程中即可。 import org.springframework.context.annotation.Bean; import org.springframework.context.annotati ...
分类:
编程语言 时间:
2020-03-24 11:12:14
阅读次数:
78
schemaLocation添加 http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd 引用地址:https://blog.csdn ...
分类:
编程语言 时间:
2020-03-24 01:05:09
阅读次数:
73
在Spring Boot项目中,出现这个错误有两种情况: 一,在main方法所在的类忘记添加@SpringBootApplication 二,缺少依赖,添加即可 <dependency> <groupId>org.springframework.boot</groupId> <artifactId> ...
分类:
移动开发 时间:
2020-03-23 20:33:18
阅读次数:
82
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> <version>1.5.2.RELEASE</version> </de ...
分类:
编程语言 时间:
2020-03-23 12:40:57
阅读次数:
74
5+1<!--spring核心jar--><dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>4.3.7.RELEASE</version></depend ...
分类:
编程语言 时间:
2020-03-22 22:27:08
阅读次数:
76