摘要:
1.静态工厂方法 /** * 静态工厂方法:直接调用某一个类的静态方法就可以返回bean实例 * * */ 1)先建立静态工厂public class StaticCarFactory { private static Map<String,Car> cars = new HashMap<Strin 阅读全文
posted @ 2019-12-19 22:45
危木星
阅读(403)
评论(0)
推荐(0)
摘要:
<!-- 实现 BeanPostProcessor 接口并具体提供两个方法postProcessBeforeInitialization:在init-method 之前被调用postProcessAfterInitialization:在init-method 之后被调用 的实现bean :bean 阅读全文
posted @ 2019-12-19 22:21
危木星
阅读(219)
评论(0)
推荐(0)
摘要:
<!-- 外部导入文件 --><context:property-placeholder location="classpath:db.properties"/> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSour 阅读全文
posted @ 2019-12-19 22:19
危木星
阅读(162)
评论(0)
推荐(0)
摘要:
<!-- 使用spel为属性赋一个字面值 --><bean id="address" class="com.mww.spring.spel.Address"><property name="city" value="#{'beijing'}"></property><property name="s 阅读全文
posted @ 2019-12-19 14:00
危木星
阅读(1068)
评论(0)
推荐(0)