![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
spring
文章平均质量分 92
sdx1237
写自己的bug,让别人无bug可写
展开
-
关于spring中AOP的aspect和advisor的理解
在开发过程中,不少有Spring Aop的使用,在面向切面编程时,我们会使用< aop:aspect>;在进行事务管理时,我们会使用< aop:advisor>。那么,对于< aop:aspect>与< aop:advisor>的区别,具体是怎样的呢?至于两者的区别,网上有很多资料,但是似乎都不能说清楚。首先,我们需要明确两者的概念。< aop:aspect>:定义切面(切面包括通知和切点)< aop:advisor>:定义通知原创 2020-12-04 14:37:33 · 1075 阅读 · 0 评论 -
注解 @Resource与@Autowired与@Component的使用
在java代码中使用@Autowired或@Resource注解方式进行装配,这两个注解的区别是:@Autowired 默认按类型装配,@Resource默认按名称装配,当找不到与名称匹配的bean才会按类型装配。 @Autowired private PersonDao personDao;//用于字段上 @Autowired public void setOrderDa原创 2017-03-01 22:00:00 · 1121 阅读 · 0 评论 -
Spring的两种依赖注入方式:setter方法注入与构造方法注入 以及两种方式的区别!
spring的两种依赖注入方式:setter注入与构造方法注入,这两种方法的不同主要就是在xml文件下对应使用property和constructor-arg属性, 例如:property属性:<property name="id" value="123"></property>(其中name的值为原类中的属性名)constructor-arg属性:<constructor-arg index="0原创 2017-03-01 22:22:07 · 22281 阅读 · 3 评论 -
spring在web.xml中的三种配置
spring有三种启动方式,使用ContextLoaderServlet,ContextLoaderListener和ContextLoaderPlugInspring3.0及以后版本中已经删除ContextLoaderServlet 和Log4jConfigServlet可以采用余下两种启动方式ContextLoaderListener和ContextLoaderPlugIn建议使用Con转载 2017-04-20 21:45:52 · 355 阅读 · 0 评论