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