Context parameters in context.xml ignored when deploying web app (Idea 10)
Hi,
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
<Parameter>elements inside this element. For example, you can create an initialization parameter like this:
<Context ...> |
||
This is equivalent to the inclusion of the following element in the web application deployment descriptor (
/WEB-INF/web.xml):
<context-param> |
||
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:
<context-param>
<param-name>ParamName</param-name>
<param-value>Value_1</param-value>
</context-param>
And my context.xml has:
<Parameter name="ParamName"
type="java.lang.String"
value="Value_2"
override="false"/>
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
~/mylocalDirectory/Caches/IntelliJIdea10/tomcat/myApplicationName/conf/Catalina/localhost/myAppName.xml
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.
Thanks
Martin
请先登录再写评论。
Looks like it's Tomcat bug: https://issues.apache.org/bugzilla/show_bug.cgi?id=50700.
--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"