摘要:
Spring Boot提倡基于Java的配置。这两篇博文主要介绍springboot 一些常用的注解介绍@value通过@Value可以将外部的值动态注入到Bean中。添加application.properties的属性,方便后面演示。 阅读全文
![SpringBoot入门教程(十八)@value、@Import、@ImportResource、@PropertySource](https://www.cnblogs.com/images/cnblogs_com/toutou/699740/o_spring.png)
摘要:
spring 2.5 中除了提供 @Component 注释外,还定义了几个拥有特殊语义的注释,它们分别是:@Repository、@Service 和 @Controller。在目前的 Spring 版本中,这 3 个注释和 @Component 是等效的,但是从注释类的命名上,很容易看出这 3 个注释分别和持久层、业务层和控制层(Web 层)相对应。 阅读全文
![SpringBoot入门教程(十七)@Service、@Controller、@Repository、@Component](https://www.cnblogs.com/images/cnblogs_com/toutou/699740/o_spring.png)