I've got a context /foo defined as follows:

<Context path="/foo" docBase="/path/to/unpacked/war">
<Parameter name="test" value="12345"/>
</Context>

I'm accessing the parameter like this:

public class FooServlet extends HttpServlet {

public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {

ServletContext sc = getServletContext();
String str = sc.getInitParameter("test");
}
}

This works fine when Tomcat is first started, and after reloading an application (using the manager). If I stop and the start the application, the "sc.getInitParameter" line above returns null. Once this happens it will continue to return null until I restart Tomcat.

I'm using both Tomcat 4.1.12 and 4.1.16beta. If I specify this as a <context-param> in web.xml it works fine, but I don't want to do this as I'm passing the name of a configuration file that should be independent of the WAR file.

Any ideas?

thanks,

Erik

/--------------------------------------------------------------------\
| Erik Erskine |
| Sundayta Ltd |
\--------------------------------------------------------------------/


--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to