美文网首页
Springboot开发常用注解说明(Continuous Up

Springboot开发常用注解说明(Continuous Up

作者: 李2牛 | 来源:发表于2018-06-08 10:37 被阅读0次
  1. @Mapper :是mybatis的注解,注明是一个 mapper接口
  2. @ControllerRestController
  • @RestController:等于@ResponseBody+@Controller,只返回return中的内容,无法解析成带有相关的后缀的视图页面。如果需要返回的是Json,Xml,mediaType需要使用这个注解。
  • @Controller:需要结合视图解析器InternalResourceViewResolver使用,返回视图的前缀名称。
  1. @Repository: spring注解,说明是一个dao访问的类或者接口
  2. @Component:使用注解需要将类申明被扫描为一个bean,可以使用@Component 注解
    5.@Service: 标注为service
  3. @PropertySource: 引入一个属性文件

相关文章

网友评论

      本文标题:Springboot开发常用注解说明(Continuous Up

      本文链接:https://www.haomeiwen.com/subject/cdoxrftx.html