2019年9月11日

Using Spring Boot —— Auto-configuration

摘要: Spring Boot auto-configuration尝试基于依赖的jar 自动配置Spring应用程序。需要添加@EnableAutoConfiguration(或者SpringBootApplication)注解 到 @Configutation类中的一个。 1.自动配置非侵入性 在任何时 阅读全文

posted @ 2019-09-11 14:15 李笑白 阅读(302) 评论(0) 推荐(0)

Using Spring Boot —— Configuration Classes

摘要: springboot支持java代码配置,尽管可以使用xml配置,但是我们建议你的主要配置可以使用一个 @Configuration 类。通常,定义main方法的类很适合作为主要的@Configuration。 1. 导入配置类 用@Import注解导入; 将@Configuration类放到@Co 阅读全文

posted @ 2019-09-11 12:27 李笑白 阅读(161) 评论(0) 推荐(0)

Using Spring Boot —— Structuring Your Code

摘要: 1.使用默认包。 不要将扫描类放到默认包下 2. Main Application Class 使用SpringBootApplication注解,它包含了下面三条注解: @EnableAutoConfiguration: enable Spring Boot’s auto-configuratio 阅读全文

posted @ 2019-09-11 11:58 李笑白 阅读(120) 评论(0) 推荐(0)

Using Spring Boot —— Build Systems

摘要: 使用spring boot —— maven构建 1.继承 starter parent 2.如果你的系统pom已经有自定义的parent,又想使用springboot。还可以直接添加如下依赖: 3. Spring Boot包含一个Maven插件,可以将项目打包为可执行jar。需要在pom中添加如下 阅读全文

posted @ 2019-09-11 11:42 李笑白 阅读(122) 评论(0) 推荐(0)

Spring @import注解

摘要: 参考:https://blog.csdn.net/boling_cavalry/article/details/82530167 常见的四种Import注解用法列举:在@Import注解的参数中可以填写类名,例如@Import(Abc.class),根据类Abc的不同类型,spring容器有以下四种 阅读全文

posted @ 2019-09-11 10:59 李笑白 阅读(334) 评论(0) 推荐(0)

导航