我正在使用JSF 2.0和Spring 3.1构建应用程序。 在Spring应用程序上下文文件中,我正在设置属性 XMLOutputFilePath
Spring ApplicationContextFile :
<bean id="placeholderConfig"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>/WEB-INF/classes/config.properties</value>
</list>
</property>
</bean>
<bean id="DetailsBean"
class="sections.DetailsBeanFactory"
factory-method="createInstance">
<constructor-arg index="0" value="${XMLOutputFilePath}" />
</bean>
当应用程序首次部署时,我正在从config.property文件中读取 XMLOutputFilePath
JSF Bean代码:
for (String filePath : _filePathList) {
System.setProperty("XMLOutputFilePath", filePath);
System.out.println("For file : " + filePath);
_context = new ClassPathXmlApplicationContext("WEB-INF/applicationContext.xml");
//Some code here
}
我想在我的JSF Bean类中做两件事:
我试图以这种方式做到但它不起作用。它不会改变 XMLOutputFilePath *值也不会读取上下文文件。
我怎么能这样做......可以帮助一下吗??