tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lenny Wintfeld <le...@cecilrep.com>
Subject Need help reading context.xml in Tomcat's conf directory
Date Wed, 13 Dec 2006 21:45:53 GMT
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


Mime
View raw message