tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jean-François Ménard" <>
Subject Re: Problem with Context Parameters
Date Tue, 08 Jul 2008 14:05:23 GMT
Thanks for your reply!

Comments inlined

2008/7/8 Christopher Schultz <>:
> Hash: SHA1
> Jean-François,
> Jean-François Ménard wrote:
> | Using Tomcat 6.0.13, I try to define some context parameters in my
> | context file (in conf/Cataline/localhost/<app_name>.xml)
> That should be conf/Catalina/localhost/<app_name>.xml

Yes, it is, just a typo in the message...

> | as described in the documentation
> | ( but it
> | simply doesn't work!  I can see the parameters defined in my web.xml,
> | but not those defined in my context file.
> indicates that <Parameter> in context.xml ought to be equivalent to
> <context-param> in web.xml.
> Have you defined the same parameter in both files? If so, you should
> take care not to set override="false", or your web.xml version will not
> be clobbered by the context.xml version.

No, the parameter is only in the context file, not in both.

> | Shouldn't the parameter be visible by the servlet context? ex.
> | context.getInitParameter("aParameterName")
> Yes, it should. Could you provide a sample context.xml and servlet that
> do not work together?

Ok, here it is.


<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app version="2.5" xmlns=""




Context file (conf/Catalina/localhost/app.xml:

<Context path="app">

  <Parameter name ="paramInContext" value="ParamValue" />


In my app, I can see the parameter defined in web.xml, not the one in
the context file...

As a side note, if I deploy the app in a standalone Tomcat, the
problem appear, but if I use the app with eclipse wtp, everything is

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message