In my catalina.bat file for Tomcat.Code:<bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="location"><value>file:D:\MyProperties.properties</value></property> </bean>
This entry is used to get the property values throughout the app.
In my java code:Code:set JAVA_OPTS=%JAVA_OPTS% -DMyProperties.fileName=D:\MyProperties.properties
Now at any point if the user wants to change the file path,Code:Properties properties = new Properties(); String fileName = System.getProperty("MyProperties.fileName"); properties.load(new DataInputStream(new FileInputStream(fileName)));
then he has to change the entry in catalina.bat file as well as in 'applicationContext.xml file' for PropertyPlaceholderConfigurer.
The valid entries for PropertyPlaceholderConfigurer are
file:
classpath:
url:
How can I force PropertyPlaceholderConfigurer to read the MyProperties.fileName entry done in catalina.bat file.
Plz help....


Reply With Quote
