- @Component 创建类对象,相当于配置
<bean/>
- @Service 与@Component 功能相同.
2.1 写在ServiceImpl 类上. - @Repository 与@Component 功能相同.
3.1 写在数据访问层类上. - @Controller 与@Component 功能相同.
4.1 写在控制器类上. - @Resource(不需要写对象的get/set)
5.1 java 中的注解
5.2 默认按照byName 注入,如果没有名称对象,按照byType 注入
5.2.1 建议把对象名称和spring 容器中对象名相同 - @Autowired(不需要写对象的get/set)
6.1 spring 的注解
6.2 默认按照byType 注入. - @Value() 获取properties 文件中内容
- @Pointcut() 定义切点
- @Aspect() 定义切面类
- @Before() 前置通知
- @After 后置通知
- @AfterReturning 后置通知,必须切点正确执行
- @AfterThrowing 异常通知
- @Arround 环绕通知
02-17
2329
05-08
05-08
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交