Context parameters in context.xml ignored when deploying web app (Idea 10)


I am using a follwing feature of Tomcat:

You can configure named values that will be made visible to the     web application as servlet context initialization parameters by nesting     

elements inside this element.  For     example, you can create an initialization parameter like this:
<Context ...>
  <Parameter name="companyName" value="My Company, Incorporated"

This is equivalent to the inclusion of the following element in the     web application deployment descriptor (

  <param-value>My Company, Incorporated</param-value>

but does not require modification of the deployment descriptor     to customize this value.

The above is placed in context.xml of my we app.

So basically I have the following in web.xml:


And my context.xml has:

<Parameter name="ParamName"

The idea is I will get value Value_2 when accessing it in JSP. Works if I deploy it as a regular war to Tomcat.

Upon deployment of artifact from Idea (local tomcat 6) i can see the context.xml copied to


So everything seems to be deployed correctly.

However when accessing ParamName I get the value from web.xml, not from context.xml

Any ideas?

I would not want to change existins web.xml/context.xml fiels for legacy reasons.



1 comment
Comment actions Permalink

Looks like it's Tomcat bug:

Nikolay Chashnikov
Software Developer
JetBrains, Inc
"Develop with pleasure!"


Please sign in to leave a comment.