You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Lenny Wintfeld <le...@cecilrep.com> on 2006/12/13 22:45:53 UTC
Need help reading context.xml in Tomcat's conf directory
Hi
I'd like to read an element from /Apache Software Foundation/Tomcat
5.5/conf/context.xml file from my program.
The element is one of many Parameter elements of the form <Parameter
name="foo" value="bar"/>
The context.xml is laid out as
< <Context allowLinking="*true*" disableProxyCaching="*true*"
cachingAllowed="*false*">
-
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<WatchedResource>META-INF/context.xml</WatchedResource>
-
<Parameter name="*javax.faces.STATE_SAVING_METHOD*"
value="*client*" override="*false*" /> =
<Parameter name="*com.sun.faces.verifyObjects*" value="*false*"
override="*false*" />
<Parameter name="*admin_dir_prefix*" value="*/svp/pkg*"
override="*false*" />
etc etc
</Context>
I would like to put the code at the start of the
MyappnameBindingImpl.java of a (axis1.4 based) web services app. The
value to be gotten is the text of a partial file path.
I've googled and found various pieces of code of the form
String bar;
HttpServlet servletContext =
(HttpServlet)MessageContext.getCurrentContext().getProperty(HTTPConstants.MC_HTTP_SERVLET);
bar = servletContext.getInitParameter( "foo");
But this does not seem to be what's required. The context.xml is not
part of the web-app servlet directory tree, its in Tomcat's conf directory.
Id appreciate some advice on getting to the "value" in a Parameter
element given the "name" using a Tomcat?? Axis?? api.
A concrete example, a reference to an example on the web or an
explanation on how to proceed would help a lot.
Thanks in advance for any help
Lenny Wintfeld
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Need help reading context.xml in Tomcat's conf directory
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Lenny Wintfeld [mailto:lenny@cecilrep.com]
> Subject: Need help reading context.xml in Tomcat's conf directory
>
> The context.xml is not part of the web-app servlet directory tree,
> its in Tomcat's conf directory.
The context.xml file in the conf directory is common to all webapps.
You can put app-specific <Context> elements in a context.xml file in the
META-INF directory of each webapp, if you wish. Look here for doc on
how to configure parameters:
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html#Context%20Pa
rameters
Note that you may also place the equivalent in the app's WEB-INF/web.xml
if that's more convenient.
Look at the Servlet spec for a description of the APIs to use to
retrieve them at run time.
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org