注解的含义:
@Component 组件的意思嘛 注入到Spring容器中 被托管
@Repository 一般用于数据访问层(持久层)
@Service 用于业务逻辑层
@Controlle 用于Controller
可以理解为注入bean 但作用域不同 比如使用@Service 注入的就不能在 @Component 中装配使用
@Controlle 是Spring-Mvc的注解
注解的含义:
@Component 组件的意思嘛 注入到Spring容器中 被托管
@Repository 一般用于数据访问层(持久层)
@Service 用于业务逻辑层
@Controlle 用于Controller
可以理解为注入bean 但作用域不同 比如使用@Service 注入的就不能在 @Component 中装配使用
@Controlle 是Spring-Mvc的注解