tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lenny Wintfeld <>
Subject Need help reading context.xml in Tomcat's conf directory
Date Wed, 13 Dec 2006 21:45:53 GMT

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*" 
        <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


I would like to put the code at the start of  the 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 =

                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:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message