日期:2014-05-17 浏览次数:20867 次
<bean id="placeholderConfig"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location"
value="classpath:com/xxxx/yyy/init.properties">
</property>
</bean>
String[] beanNames = beanFactory.getBeanDefinitionNames();
for (String beanName : beanNames) {
BeanDefinition bd = beanFactory.getBeanDefinition(beanName);
ConstructorArgumentValues cavs = bd.getConstructorArgumentValues();
List lst = cavs.getGenericArgumentValues();
Iterator it = lst.iterator();
while (it.hasNext()) {
ValueHolder vh = (ValueHolder) it.next();
TypedStringValue tsv = (TypedStringValue) vh.getValue();
System.out.println(tsv.getValue());//输出bbbbb
}
}
<sqlMapConfig>
<properties resource="com/xxxx/yyy/init.properties"/>
<typeAlias alias="order" type="testdomain.Order"/>
<!-- JDBC -->
<transactionManager type="JDBC">
<dataSource type="SIMPLE">
<property value="${MyDriver}" name="JDBC.Driver"/>
<property value="${MyDriver}" name="JDBC.ConnectionURL"/>
<property value="${MyDriver}" name="JDBC.Username"/>
<property value="${MyDriver}" name="JDBC.Password"/>
<property name="JDBC.DefaultAutoCommit" value="true" />
</dataSource>
</transactionManager>
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath*:config/jdbc.properties</value>
<value>classpath*:config/hibernate.properties</value>
<value>classpath*:config/uamsHibernate