上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 37 下一页
摘要: 1、exclude 不装配指定bean 2、scanBasePackages 运行http://localhost:8080/hello 输出:Hello,遥远2 说明,成功。 阅读全文
posted @ 2019-10-19 22:23 遥远2 阅读(6414) 评论(0) 推荐(0)
摘要: 1、@SpringBootApplication 等价于 @Configuration+@EnableAutoConfiguration+@ComponentScan,且他们均使用默认属性。如: 等价于 2、@SpringBootApplication 源码 如:不装配指定类 3、关系 阅读全文
posted @ 2019-10-19 21:57 遥远2 阅读(253) 评论(0) 推荐(0)
摘要: 所谓的自动装配,就是 autowire。 如何激活自动装配呢? 方法一:@EnableAutoConfiguration或@SpringBootApplication,写在@Configuration的类上。 方法二:对于xml的<context:component-scan>,采用ClassPat 阅读全文
posted @ 2019-10-19 21:13 遥远2 阅读(206) 评论(0) 推荐(0)
摘要: application.properties MyConfig.java 初始化: 输出: 阅读全文
posted @ 2019-10-19 19:40 遥远2 阅读(2473) 评论(0) 推荐(0)
摘要: 普通servlet 容器 1、tomcat 2、jetty 3、undertow Reactive web容器 1、undertow 务必去掉:spring-boot-starter-web,否则spring-boot-starter-webflux会不起作用。 2、jetty 3、tomcat 阅读全文
posted @ 2019-10-19 18:16 遥远2 阅读(207) 评论(0) 推荐(0)
摘要: 环境:采用idea2018.3.4、maven3.6.2 问题:创建springboot项目后,右下角弹出 而且,依赖包都没有加载到。 解决:idea2018.3.4 采用maven3.5.0解决。 阅读全文
posted @ 2019-10-19 18:02 遥远2 阅读(215) 评论(0) 推荐(0)
摘要: 1、springboot个版本系统需求 spring boot maven jdk 内置tomcat 内置jetty servlet 2.0.x 3.2+ 8或9 8.5(3.1) 9.4(3.1) 3.1+ 2.1.x 3.3+ 8或9 9(4.0) 9.4(3.1) 3.1+ 2.2.x 3.3 阅读全文
posted @ 2019-10-19 14:29 遥远2 阅读(170) 评论(0) 推荐(0)
摘要: 创建springboot项目,且不采用<parent>引入springboot时,pom.xml如下: 执行 控制台报错: 原因:当设置为war时,web.xml必须存在。 解决:可通过插件配置属性将其忽略。 首先,spring-boot-dependencies 这个pom文件,找到 找到版本号是 阅读全文
posted @ 2019-10-19 13:09 遥远2 阅读(2385) 评论(0) 推荐(0)
摘要: 客户端当发送空的json字符串时,请求RestController时,报错: 解决方法是加上: 阅读全文
posted @ 2019-10-11 13:26 遥远2 阅读(2523) 评论(0) 推荐(0)
摘要: 解决: 1.输入 等1.都下载完毕后,在点击2.即Reimport 阅读全文
posted @ 2019-10-08 10:26 遥远2 阅读(3335) 评论(0) 推荐(0)
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 37 下一页