Spring中常用注解

事务相关

  • @EnableTransactionManagement //开启事务支持
  • @Transactional //具体使用事务的方法或类

切面相关

  • @EnableAspectJAutoProxy //开启注解版的AOP功能

组件扫描与配置类

  • @Component
  • @Controller
  • @Service
  • @Repository
  • @ComponentScan
  • @Bean
  • @Conditional //Bean装配时限制条件
  • @Configuration
  • @Import
  • @Lazy
  • @PropertySource

依赖注入

  • @Autowired
  • @Qualifier
  • @Value

web

  • @RequestMapping
  • @Get/Post/Put/Delete/Patch Mapping
  • @ResponseBody
  • @RestController
  • @RequestBody
  • @ControllerAdvice
  • @ExceptionHandler
  • @RequestParam
  • @PathVariable
  • @CrossOrigin

其它

  • @Order //定义Spring IOC容器中Bean的执行顺序的优先级
posted @   程长新  阅读(14)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek “源神”启动!「GitHub 热点速览」
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· C# 集成 DeepSeek 模型实现 AI 私有化(本地部署与 API 调用教程)
· DeepSeek R1 简明指南:架构、训练、本地部署及硬件要求
· 2 本地部署DeepSeek模型构建本地知识库+联网搜索详细步骤
点击右上角即可分享
微信分享提示