Where are you getting the config from?  I'm running a web service using
Axis(the reason I asked on here), and I used wsdl2java, so I don't really
have a hook to the underlying stuff.  Can I still pull the properties, or do
I need to get ahold of the axis servlet?

Chris

-----Original Message-----
From: Barlotta, Timothy - Arlington, VA - Contractor
[mailto:[EMAIL PROTECTED]
Sent: Monday, October 11, 2004 11:54 AM
To: [EMAIL PROTECTED]
Subject: RE: Configuration setup with web.xml


Not really a question for the Axis forum but:

If you have a servlet filter and are trying to pass in whether you want
it on or not, the code would go in the init method.
        public void init(FilterConfig config) throws ServletException {
                if(log.isDebugEnabled()) {
                        log.debug("init");
                }
                fc = config;
                // get init paramters
                String s = fc.getInitParameter("enabled");
                if(s==null) {
                        enabled = true;
                }
                else if(s.equalsIgnoreCase("false")) {
                        enabled = false;
                }

                if(log.isDebugEnabled()) {
                        if(enabled) {
                                log.debug("SecureFilter:enabled");
                        }
                        else {
                                log.debug("SecureFilter:disabled");
                        }
                }
        }

web.xml snippet
        <filter>
                <filter-name>SecureFilter</filter-name>
        
<filter-class>com.usps.wws.filter.SecureFilter</filter-class>

                <init-param>
                        <param-name>enabled</param-name>
                        <param-value>false</param-value>
                </init-param>
        </filter>

Servlet itself:
would be similar do it in the init method (except ServletConfig is past
in).

Tim


> -----Original Message-----
> From: Hubble, Christopher [mailto:[EMAIL PROTECTED] 
> Sent: Monday, October 11, 2004 11:43 AM
> To: [EMAIL PROTECTED]
> Subject: Configuration setup with web.xml
> 
> 
> How do I define something in the web.xml file and read it 
> into my program?
> 
> Chris
> 

Reply via email to