File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

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!
[ February 29, 2004: Message edited by: Tonny Tssagovic ]
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13036
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()
I agree. Here's the link:
subject: Env. Sys. variables.
It's not a secret anymore!