protected RewrittenOutboundUrl processEncodeURL(HttpServletResponse hsResponse,HttpServletRequest hsRequest,boolean encodeUrlHasBeenRun,String outboundUrl){
  if (log.isDebugEnabled()) {
    log.debug("processing outbound url for " + outboundUrl);
  }
  if (outboundUrl == null) {
    return new RewrittenOutboundUrl(null,true);
  }
  boolean finalEncodeOutboundUrl=true;
  String finalToUrl=outboundUrl;
  final List outboundRules=conf.getOutboundRules();
  try {
    for (int i=0; i < outboundRules.size(); i++) {
      final OutboundRule outboundRule=(OutboundRule)outboundRules.get(i);
      if (!encodeUrlHasBeenRun && outboundRule.isEncodeFirst()) {
        continue;
      }
      if (encodeUrlHasBeenRun && !outboundRule.isEncodeFirst()) {
        continue;
      }
      final RewrittenOutboundUrl rewrittenUrl=outboundRule.execute(finalToUrl,hsRequest,hsResponse);
      if (rewrittenUrl != null) {
        if (log.isDebugEnabled()) {
          log.debug("\"" + outboundRule.getDisplayName() + "\" matched");
        }
        finalToUrl=rewrittenUrl.getTarget();
        finalEncodeOutboundUrl=rewrittenUrl.isEncode();
        if (outboundRule.isLast()) {
          log.debug("rule is last");
          break;
        }
      }
    }
  }
 catch (  InvocationTargetException e) {
    try {
      handleInvocationTargetException(hsRequest,hsResponse,e);
    }
 catch (    ServletException e1) {
      log.error(e1);
    }
catch (    IOException e1) {
      log.error(e1);
    }
  }
  return new RewrittenOutboundUrl(finalToUrl,finalEncodeOutboundUrl);
}

protected RewrittenOutboundUrl processEncodeURL ( HttpServletResponse hsResponse , HttpServletRequest hsRequest , boolean encodeUrlHasBeenRun , String outboundUrl ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "processing outbound url for " + outboundUrl ) ; } if ( outboundUrl == null ) { return new RewrittenOutboundUrl ( null , true ) ; } boolean finalEncodeOutboundUrl = true ; String finalToUrl = outboundUrl ; final List outboundRules = conf . getOutboundRules ( ) ; try { for ( int i = 0 ; i < outboundRules . size ( ) ; i ++ ) { final OutboundRule outboundRule = ( OutboundRule ) outboundRules . get ( i ) ; if ( ! encodeUrlHasBeenRun && outboundRule . isEncodeFirst ( ) ) { continue ; } if ( encodeUrlHasBeenRun && ! outboundRule . isEncodeFirst ( ) ) { continue ; } final RewrittenOutboundUrl rewrittenUrl = outboundRule . execute ( finalToUrl , hsRequest , hsResponse ) ; if ( rewrittenUrl != null ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "\"" + outboundRule . getDisplayName ( ) + "\" matched" ) ; } finalToUrl = rewrittenUrl . getTarget ( ) ; finalEncodeOutboundUrl = rewrittenUrl . isEncode ( ) ; if ( outboundRule . isLast ( ) ) { log . debug ( "rule is last" ) ; break ; } } } } catch ( InvocationTargetException e ) { try { handleInvocationTargetException ( hsRequest , hsResponse , e ) ; } catch ( ServletException e1 ) { log . error ( e1 ) ; } catch ( IOException e1 ) { log . error ( e1 ) ; } } return new RewrittenOutboundUrl ( finalToUrl , finalEncodeOutboundUrl ) ; }
handles rewriting urls in jsp ' s etc , i . e . response . encodeurl ( ) is overriden in the response wrapper .
