2016年10月13日

@EnableAutoConfiguration

摘要: 1. spring文档 解释一: Enable auto-configuration of the Spring Application Context, attempting to guess and configure beans that you are likely to need. Aut 阅读全文

posted @ 2016-10-13 18:02 shuimx 阅读(458) 评论(0) 推荐(0)

@SpringBootApplication

摘要: 1. spring 文档说明 Many Spring Boot developers always have their main class annotated with @Configuration, @EnableAutoConfiguration and @ComponentScan. Si 阅读全文

posted @ 2016-10-13 16:41 shuimx 阅读(521) 评论(0) 推荐(0)

@Component

摘要: 1. 定义:注解类、接口、注解、枚举。 2. spring 文档说明: The @Repository annotation is a marker for any class that fulfills the role or stereotype (also known as Data Acce 阅读全文

posted @ 2016-10-13 16:34 shuimx 阅读(534) 评论(0) 推荐(0)

spring 自动扫描、注册的类是否可以定义构造函数

摘要: 答案是肯定的。 方法如下: SimpleMovieLister类会被spring扫描并注册到 ApplicationContext中。 要注意:1 构造函数用@Autowired 注解 2 构造函数的参数如果需要其他对象,则参数对象也要是可以自动注入的。 阅读全文

posted @ 2016-10-13 11:32 shuimx 阅读(211) 评论(0) 推荐(0)

导航