wood burning stoves 2.0*
The moose likes Servlets and the fly likes Env. Sys. variables. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Env. Sys. variables." Watch "Env. Sys. variables." New topic
Author

Env. Sys. variables.

Tonny Tssagovic
Ranch Hand

Joined: Dec 30, 2003
Posts: 226
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

Joined: Mar 22, 2000
Posts: 12769
    
    5
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Env. Sys. variables.