• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

propertyFile Location

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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");
reply
    Bookmark Topic Watch Topic
  • New Topic