美文网首页
springmvc中xml获取properties中的值通过@V

springmvc中xml获取properties中的值通过@V

作者: cmeizu | 来源:发表于2019-01-10 18:39 被阅读0次

<bean id="configProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean">

 <property name="locations"> 

 <list> 

 <value>classpath:*.properties</value> 

 </list> </property> </bean> <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer"> 

 <property name="properties" ref="configProperties"/>

 </bean>

以上的这段代码就可以解决问题.

相关文章

网友评论

      本文标题:springmvc中xml获取properties中的值通过@V

      本文链接:https://www.haomeiwen.com/subject/irxzrqtx.html