Package org.tuckey.web.filters.urlrewrite

Examples of org.tuckey.web.filters.urlrewrite.UrlRewriter


        } else {
            logger.error("rewrite configuration is NOT ok");
            return;
        }

        rewriter = new UrlRewriter(conf);
        logger.info("rewrite engine is enabled: {}", conf.isEngineEnabled());
        if (conf.getRules() != null) {
            logger.info("number of rewrite rules: {}", conf.getRules().size());
        } else {
            logger.info("no rewrite rules");
View Full Code Here


   }

   private void checkConfLocal(final Conf conf)
   {
      if (conf.isOk() && conf.isEngineEnabled()) {
         urlRewriter = new UrlRewriter(conf);
         log.debug("Tuckey UrlRewriteFilter configuration loaded (Status: OK)");
      }
      else {
         if (!conf.isOk()) {
            log.error("Tuckey UrlRewriteFilter configuration failed (Status: ERROR)");
View Full Code Here

        if (!enabled) {
            chain.doFilter(request, response);
            return;
        }

        UrlRewriter urlRewriter = urlRewriteService.getEngine();

        final HttpServletRequest hsRequest = (HttpServletRequest) request;
        HttpServletResponse hsResponse = outboundRulesEnabled ? new UrlRewriteWrappedResponse(
                (HttpServletResponse) response, hsRequest, urlRewriter)
                : (HttpServletResponse) response;

        hsResponse = new SessionidRemovalResponseWrapper(hsRequest, hsResponse);

        // check for status request
        String uri = hsRequest.getRequestURI();

        logger.debug("Handling {}", uri);

        if (statusEnabled
                && uri != null
                && uri.startsWith(hsRequest.getContextPath() + statusPath)
                && (statusServerNameMatcher == null || statusServerNameMatcher.isMatch(request
                        .getServerName()))) {
            showStatus(hsRequest, hsResponse);
            return;
        }

        if (!urlRewriteService.prepareInbound(hsRequest, hsResponse)) {
            chain.doFilter(hsRequest, hsResponse);
            return;
        }
       
        // if no rewrite has taken place continue as normal
        if (!urlRewriter.processRequest(hsRequest, hsResponse, chain)) {
            chain.doFilter(hsRequest, hsResponse);
        } else if (hsRequest.getAttribute("UrlRewriteFilter.sendError") != null) {
            // workaround: call sendError with the specified error code
            hsResponse.sendError(Integer.valueOf((String) hsRequest.getAttribute("UrlRewriteFilter.sendError")));
        }
View Full Code Here

                throw new IllegalStateException("Error configuring config file: " + configFile);
            }
        }

        if (urlRewriter == null) {
            urlRewriter = new UrlRewriter(conf);
        }
    }
View Full Code Here

TOP

Related Classes of org.tuckey.web.filters.urlrewrite.UrlRewriter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.