1.@Component

  创建类对象,相当于配置<bean/>

2.@Service

  @Service与@Component功能相同,写在ServiceImpl类上

3.@Repository

  @Repository与@Component功能相同,写在数据访问层类上

4.@Controller

  @Controller与@Component功能相同,写在控制器类上

5.@Resource

  java中的注解

  默认按照byName注入,如果没有名称对象,按照byType注入

    建议对象名称和spring容器中对象名相同

  不需要写对象的get/set方法

6.@Autowired

  spring中的注解

  默认按照byType注入

  不需要写对象的get/set方法

7.@Value()      获取properties文件中内容

8.@Pointcut()  定义切点

9.@Aspect()    定义切面类

10.@Before()  前置通知

11.@After()     后置通知

12.@AfterReturning()  后置通知,必须切点正确执行

13.@AfterThrowing()   异常通知

14.@Arround()       环绕通知

  

相关文章:

  • 2021-05-27
  • 2021-05-21
猜你喜欢
  • 2021-09-29
  • 2022-12-23
  • 2021-09-18
  • 2022-01-01
  • 2021-08-04
  • 2022-12-23
相关资源
相似解决方案