随笔分类 -  Spring

Spring 技术学习
摘要:新建一个JavaBeanUserBeanFactoryPostProcessor 实现了BeanFactoryPostProcessor接口Spring配置文件如下:编写测试用例从结果可以看出:因为BeanFactoryPostProcessor中输出的username已经变成了quanyongan... 阅读全文
posted @ 2014-08-19 12:36 QuantSeven 阅读(1859) 评论(0) 推荐(0)
摘要:Spring中有两种类型的Bean,一种是普通Bean,另一种是工厂Bean,即FactoryBean。工厂Bean跟普通Bean不同,其返回的对象不是指定类的一个实例,其返回的是该工厂Bean的getObject方法所返回的对象。如果大家有看过Mybatis的SessionFactoryBean和... 阅读全文
posted @ 2014-08-19 12:36 QuantSeven 阅读(10639) 评论(1) 推荐(2)
摘要:加载Spring配置文件时,如果Spring配置文件中所定义的Bean类实现了ApplicationContextAware 接口,那么在加载Spring配置文件时,会自动调用ApplicationContextAware 接口中的public void setApplicationConte... 阅读全文
posted @ 2014-07-31 18:01 QuantSeven 阅读(888) 评论(0) 推荐(0)
摘要:Spring3.x 获取properties资源文件的值有两种方式:第一种:使用标签然后在Spring的xml文件中就使用${jdbc.driver}获取第二种:使用 标签(1)在java文件中使用@Value("#{props['..']}")获取资源文件的值(2)在xml文件中使用#{props... 阅读全文
posted @ 2014-07-31 17:55 QuantSeven 阅读(958) 评论(0) 推荐(0)