[b]1,sping配置文件中引用properties文件中的变量[/b]
[b]2,spring 国际化资源文件properties文件使用[/b]
<!-- 定义应用程序的资源文件 -->
[b]3,应用程序中使用properties文件[/b]
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:jdbc.properties</value>
</list>
</property>
</bean>
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="${jdbc.driverClassName}" />
<property name="url" value="${jdbc.url}" />
<property name="username" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
</bean>
[b]2,spring 国际化资源文件properties文件使用[/b]
<!-- 定义应用程序的资源文件 -->
<bean id="messageSource"
class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basenames">
<list>
<value>/WEB-INF/message/bsapp/bsapp_language</value>
<value>/WEB-INF/message/capp/caapp_language</value>
<value>/WEB-INF/message/cmapp/bussiness/bussiness</value>
</list>
</property>
<property name="cacheSeconds" value="0" />
</bean>
[b]3,应用程序中使用properties文件[/b]