This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Env. Sys. variables.

 
Tonny Tssagovic
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello people,
I have an API (to which no real doc/code exists) and I made a simple standalone application that works fine. Now I want to make this feature available via a servlet.
To run the simple app, I use a .bat file provided by the API, which passes some sys variables (I don't have clue what they are) when running java: For example java -Dblahblah=blahblah -Dfoo=foo my appp %1%2-...
How can I pass these to my servlet? I am just using

For before each call to the function that uses the Api (which iself needs these variables)
But it does not seem to work!
Is this the way to go ?ideas?
ANd another important think is that some of these params are some proprieties files that are needed by the API, where should I place these files to be accessible to tomcat, when it calls a function of these APIs? Under lib, or anything in the classpath will do ??
Any help will be very much appreciated!
Thanks
[ February 29, 2004: Message edited by: Tonny Tssagovic ]
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13056
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A good place for properties files is under WEB-INF - that way you can get at them without any disk path information and they can't be accidently exposed. See ServletContext getResourceAsStream()
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic