J
Jonck van der Kogel
Hi everybody,
I'm having some problems passing parameters into my servlet and am
hoping that some of you may be able to help me.
I'm using a 3d party jar file, that (as their JavaDoc says) looks for
a configFile system parameter. When I run my app as a regular class
with a main method (which uses some classes from the 3d party jar)
from the command-line, I have to add the parameter
-configFile="conf/config.cfg"
When I add this parameter (which is the path to the config file)
everything works fine.
What I really need however is to use the classes from the 3d party jar
in a servlet. I thought at first that I could pass parameters to the
servlet by putting the following lines in my web.xml file (I'm using
Tomcat 5):
<init-param>
<param-name>configFile</param-name>
<param-value>config.cfg</param-value>
</init-param>
The paramaters are passed fine (tested it by using the
getInitParameters method), but the 3d party jar doesn't find it.
Therefore my question is, do the initial parameters that can be passed
in the web.xml file function as parameters that are passed on the
command-line or are they somehow different?
Is there a way to "fake it", in other words reading in the parameters
and then setting the system parameter that the 3d party jar is looking
for?
Thanks very much for any help, Jonck
I'm having some problems passing parameters into my servlet and am
hoping that some of you may be able to help me.
I'm using a 3d party jar file, that (as their JavaDoc says) looks for
a configFile system parameter. When I run my app as a regular class
with a main method (which uses some classes from the 3d party jar)
from the command-line, I have to add the parameter
-configFile="conf/config.cfg"
When I add this parameter (which is the path to the config file)
everything works fine.
What I really need however is to use the classes from the 3d party jar
in a servlet. I thought at first that I could pass parameters to the
servlet by putting the following lines in my web.xml file (I'm using
Tomcat 5):
<init-param>
<param-name>configFile</param-name>
<param-value>config.cfg</param-value>
</init-param>
The paramaters are passed fine (tested it by using the
getInitParameters method), but the 3d party jar doesn't find it.
Therefore my question is, do the initial parameters that can be passed
in the web.xml file function as parameters that are passed on the
command-line or are they somehow different?
Is there a way to "fake it", in other words reading in the parameters
and then setting the system parameter that the 3d party jar is looking
for?
Thanks very much for any help, Jonck