竹径风声

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
 1. @Component创建类对象,相当于配置<bean/>
2. @Service与@Component功能相同,
      2.1写在Servicelmpl类上.
3. @Repository与@Component功能相同
      3.1写在数据访问层类上.
4. @Controller与@Component功能相同
      4.1写在控制器类上,
5. @Resource(不需要写对象的get/set)
      5.1 java中的注解
      5.2默认按照byName注入,如果没有名称对象,按照byType注入
        5.2.1建议把对象名称和spring容器中对象名相同
6. @Autowired(不需要写对象的get/set)
      6.1 spring的注解
      6.2默认按照byType注入.
7. @Value() 获取properties文件中内容
8. @Pointcut() 定义切点
9. @Aspect()定义切面类
10. @Before() 前置通知
11. @After 后置通知
12. @AfterReturning后置通知,必须切点正确执行
13. @AfterThrowing异常通知
14. @Arround环绕通知
 
 
 
 
 
 
 
 
 
 
 
 
posted on 2019-06-03 11:22  竹径风声  阅读(147)  评论(0)    收藏  举报