zoukankan      html  css  js  c++  java
  • Spring -13 -Spring 中常用注解总结

    1.@Component 创建类对象,相当于配置<bean/>
    2.@Service 与@Component 功能相同.
      2.1都写在ServiceImpl 类上.
    3.@Repository 与@Component 功能相同.   3.1写在数据访问层类上.
    4.@Controller 与@Component 功能相同.   4.1写在控制器类上.
    5.@Resource(不需要写对象的get/set)   5.1java 中的注解   5.2默认按照byName 注入,如果没有名称对象,按照byType 注入   5.2.1建议把对象名称和spring 容器中对象名相同
    6.@Autowired(不需要写对象的get/set) 6.1spring 的注解 6.2默认按照byType 注入.
    7.@Value() 获取properties 文件中内容 8.@Pointcut() 定义切点
    9.@Aspect() 定义切面类 10.@Before() 前置通知 11.@After() 后置通知
    12.@AfterReturning 后置通知,必须切点正确执行 13.@AfterThrowing 异常通知 14.@Arround 环绕通知
  • 相关阅读:
    html 3
    html标签2
    html标签
    2017.4.27
    2017.4.26
    2017.4.25
    2017.4.20
    2017.1.18
    2017.4.17
    2017.4.16.
  • 原文地址:https://www.cnblogs.com/zhazhaacmer/p/10136811.html
Copyright © 2011-2022 走看看