Java 将字符串从文件加载到Springbean属性
在我的spring xml文件中,我有一个bean:Java 将字符串从文件加载到Springbean属性,java,xml,spring,spring-mvc,file-io,Java,Xml,Spring,Spring Mvc,File Io,在我的spring xml文件中,我有一个bean: <bean id="config" class="com.example.BeanConfig"> <property name="description" value="Long Description Here" /> </bean> 我想从description.txt读取字符串,而不是内联定义长字符串。有没有办法在xml中做到这一点而不编写Java类来处理它 我已经遇到过,但我不清
<bean id="config" class="com.example.BeanConfig">
<property name="description" value="Long Description Here" />
</bean>
我想从description.txt读取字符串,而不是内联定义长字符串。有没有办法在xml中做到这一点而不编写Java类来处理它
我已经遇到过,但我不清楚如何将bean内容转换为属性值。您可以使用Spring的属性占位符和${property\u name}请参见您可以使用Spring的属性占位符和${property\u name}请参见