Can anyone please suggest me a best practice for custom properties in struts 1.2, I mean where to place the properties file (under WEB-INF or somewhere else) and how to access or address them relatively from struts Action class.
Siva Masilamani
Ranch Hand
Joined: Sep 19, 2008
Posts: 377
posted
0
I put the property file in a particular place where i used to put all the property file for different appliation.
Note : the above paths are not intended appropriately
Then in the server(Application or webserver) configuration ,i pass the path to the property file as system property via JVM argument.
like -DAPP2Prop=path to app2.properties -DApp1Property=path to app1.properties.
Then whn you run the application you can read it as System.getProperty(App2Prop) and pass it to the argument as Property constructor.
Well i am not sure this is a good idea or not? But this works atlease for me so far.
But I need to package the properties file along with the war.. So I would like to know where should I drop the file in WEB-INF or somewhere else and how can I access it relatively in Action class...