• Post Reply Bookmark Topic Watch Topic
  • New Topic

propertyFile Location  RSS feed

 
Per Lovdinger
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
The problem is this:
When I deploy different Java applications, it could be war applications,
ordinary application, in most cases it's practical to use a propertyFile
so that the properties are not hardcoded.
Sometimes I want to deploy the application to Windows and sometimes it could be Unix.
I'm using ant as a deployment tool...
The problem is that I do not want to hardcode the location of the propertyFile.
One idea would be to:
- create a text file "propertyFileLocation.txt" where the location is edited
- put that file in the jar file
- and have the application to read the location from the jar
Does anyone have a better idea ?
thanks in advance,
Per
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
put your Property files into the classpath e.g.%APP_HOME/WEB-INF/classes. Then you can load them with ResourceBundle.getBundle("filename");
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!