public void doFilter(final ServletRequest request,final ServletResponse response,final FilterChain chain) throws IOException, ServletException {
  UrlRewriter urlRewriter=getUrlRewriter(request,response,chain);
  final HttpServletRequest hsRequest=(HttpServletRequest)request;
  final HttpServletResponse hsResponse=(HttpServletResponse)response;
  UrlRewriteWrappedResponse urlRewriteWrappedResponse=new UrlRewriteWrappedResponse(hsResponse,hsRequest,urlRewriter);
  if (statusEnabled && statusServerNameMatcher.isMatch(request.getServerName())) {
    String uri=hsRequest.getRequestURI();
    if (log.isDebugEnabled()) {
      log.debug("checking for status path on " + uri);
    }
    String contextPath=hsRequest.getContextPath();
    if (uri != null && uri.startsWith(contextPath + statusPath)) {
      showStatus(hsRequest,urlRewriteWrappedResponse);
      return;
    }
  }
  boolean requestRewritten=false;
  if (urlRewriter != null) {
    requestRewritten=urlRewriter.processRequest(hsRequest,urlRewriteWrappedResponse,chain);
  }
 else {
    if (log.isDebugEnabled()) {
      log.debug("urlRewriter engine not loaded ignoring request (could be a conf file problem)");
    }
  }
  if (!requestRewritten) {
    chain.doFilter(hsRequest,urlRewriteWrappedResponse);
  }
}

public void doFilter ( final ServletRequest request , final ServletResponse response , final FilterChain chain ) throws IOException , ServletException { UrlRewriter urlRewriter = getUrlRewriter ( request , response , chain ) ; final HttpServletRequest hsRequest = ( HttpServletRequest ) request ; final HttpServletResponse hsResponse = ( HttpServletResponse ) response ; UrlRewriteWrappedResponse urlRewriteWrappedResponse = new UrlRewriteWrappedResponse ( hsResponse , hsRequest , urlRewriter ) ; if ( statusEnabled && statusServerNameMatcher . isMatch ( request . getServerName ( ) ) ) { String uri = hsRequest . getRequestURI ( ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( "checking for status path on " + uri ) ; } String contextPath = hsRequest . getContextPath ( ) ; if ( uri != null && uri . startsWith ( contextPath + statusPath ) ) { showStatus ( hsRequest , urlRewriteWrappedResponse ) ; return ; } } boolean requestRewritten = false ; if ( urlRewriter != null ) { requestRewritten = urlRewriter . processRequest ( hsRequest , urlRewriteWrappedResponse , chain ) ; } else { if ( log . isDebugEnabled ( ) ) { log . debug ( "urlRewriter engine not loaded ignoring request (could be a conf file problem)" ) ; } } if ( ! requestRewritten ) { chain . doFilter ( hsRequest , urlRewriteWrappedResponse ) ; } }
the main method called for each request that this filter is mapped for .
