@service注解的简介和使用范例



spring2.5之后出现的注解,就跟在spring配置文件里配置bean差不多的功能,就是让spring自动扫描管理组件,@Service  @Controller @Repository @Component ,这四个其实是一样的功能,没有区别,只是在MVC模式上表示的层不一样,service一般标注在service层的bean上,controller标注在控制层,@Repository标注在view层,component通用




Spring注解:Spring的常用注解

posted @ 2022-01-27 18:36  zhangdaopin  阅读(493)  评论(0编辑  收藏  举报