• 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
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

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");
 
Your mother is a hamster and your father smells of tiny ads!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic