You can't do it from the config alone (the spec doesn't have exclude 
mappings).  You would need to do it from within your Filter code, e.g.:

public class RewriteFilter implements Filter {
     public void init(FilterConfig conf) {
         // init logic here
     }
     public void destroy() {
        // release resources here
     }
     public void doFilter(ServletRequest req, ServletResponse res, 
FilterChain chain)
     throws ServletException, IOException {
          if(forMe(req)) {
              // business logic here
          }
          chain.doFilter(req, res);
     }
     private boolean forMe(ServletRequest req) {
         if(req instanceof HttpServletRequest) {
             HttpServletRequest hreq = (HttpServletRequest)req;
             return ! hreq.getRequestURI().endsWith(".earth");
         }
         return true;
    }
}

"kkus" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>
> Hi,
>
> For the following setting in web.xml, if I have a request like /*.earth 
> how
> can I exclude it from these filters? I don't want to filters to handle
> request from /*.earth. Thanks!
>
> <filter-mapping>
>        <filter-name>rewriteFilter</filter-name>
>        <url-pattern>/*</url-pattern>
>    </filter-mapping>
>    <filter-mapping>
>        <filter-name>sitemesh</filter-name>
>        <url-pattern>/*</url-pattern>
>    </filter-mapping>
> -- 
> View this message in context: 
> http://www.nabble.com/How-can-I-exclude-in-%3Curl-pattern%3E-for-filters-in-Tomcat-5.5.20--tf4937775.html#a14133848
> Sent from the Tomcat - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> 




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to