/** * Rewrite the given URL using the provided {@link RewriteRule} object. Process the URL only if the rule is set to * outbound="true" * * @return The rewritten URL, or the unchanged URL if no action was taken. */ public String processOutbound(final HttpServletRequest request, final HttpServletResponse response, final RewriteRule rule, final String url) { String result = url; if ((rule != null) && rule.isOutbound() && rule.matches(url)) { for (Processor p : processors) { result = p.processOutbound(request, response, rule, result); } } return result; }
/** * Rewrite the given URL using the provided {@link RewriteRule} object as a set of rules. * * @return The rewritten URL, or the unchanged URL if no action was taken. */ public String processInbound(final HttpServletRequest request, final HttpServletResponse response, final RewriteRule rule, final String url) { String result = url; if ((rule != null) && rule.isInbound() && rule.matches(url)) { for (Processor p : processors) { result = p.processInbound(request, response, rule, result); } } return result; }
private String rewrite(final String url) { String result = ""; if (url != null) { String strippedUrl = stripContextPath(url); if (!strippedUrl.equals(url)) { result = contextPath; } try { for (RewriteRule c : prettyConfig.getGlobalRewriteRules()) { strippedUrl = rewriteEngine.processOutbound(request, this, c, strippedUrl); } result += strippedUrl; } catch (Exception e) { throw new PrettyException("Error occurred during canonicalization of request <[" + url + "]>", e); } } return result; }
/** * Rewrite the given URL using the provided {@link RewriteRule} object. Process the URL only if the rule is set to * outbound="true" * * @return The rewritten URL, or the unchanged URL if no action was taken. */ public String processOutbound(final HttpServletRequest request, final HttpServletResponse response, final RewriteRule rule, final String url) { String result = url; if ((rule != null) && rule.isOutbound() && rule.matches(url)) { for (Processor p : processors) { result = p.processOutbound(request, response, rule, result); } } return result; }
/** * Rewrite the given URL using the provided {@link RewriteRule} object as a set of rules. * * @return The rewritten URL, or the unchanged URL if no action was taken. */ public String processInbound(final HttpServletRequest request, final HttpServletResponse response, final RewriteRule rule, final String url) { String result = url; if ((rule != null) && rule.isInbound() && rule.matches(url)) { for (Processor p : processors) { result = p.processInbound(request, response, rule, result); } } return result; }
private String rewrite(final String url) { String result = ""; if (url != null) { String strippedUrl = stripContextPath(url); if (!strippedUrl.equals(url)) { result = contextPath; } try { for (RewriteRule c : prettyConfig.getGlobalRewriteRules()) { strippedUrl = rewriteEngine.processOutbound(request, this, c, strippedUrl); } result += strippedUrl; } catch (Exception e) { throw new PrettyException("Error occurred during canonicalization of request <[" + url + "]>", e); } } return result; }
/** * Rewrite the given URL using the provided {@link RewriteRule} object. Process the URL only if the rule is set to * outbound="true" * * @return The rewritten URL, or the unchanged URL if no action was taken. */ public String processOutbound(final HttpServletRequest request, final HttpServletResponse response, final RewriteRule rule, final String url) { String result = url; if ((rule != null) && rule.isOutbound() && rule.matches(url)) { for (Processor p : processors) { result = p.processOutbound(request, response, rule, result); } } return result; }
/** * Rewrite the given URL using the provided {@link RewriteRule} object as a set of rules. * * @return The rewritten URL, or the unchanged URL if no action was taken. */ public String processInbound(final HttpServletRequest request, final HttpServletResponse response, final RewriteRule rule, final String url) { String result = url; if ((rule != null) && rule.isInbound() && rule.matches(url)) { for (Processor p : processors) { result = p.processInbound(request, response, rule, result); } } return result; }
private String rewrite(final String url) { String result = ""; if (url != null) { String strippedUrl = stripContextPath(url); if (!strippedUrl.equals(url)) { result = contextPath; } try { for (RewriteRule c : prettyConfig.getGlobalRewriteRules()) { strippedUrl = rewriteEngine.processOutbound(request, this, c, strippedUrl); } result += strippedUrl; } catch (Exception e) { throw new PrettyException("Error occurred during canonicalization of request <[" + url + "]>", e); } } return result; }
/** * Rewrite the given URL using the provided {@link RewriteRule} object. Process the URL only if the rule is set to * outbound="true" * * @return The rewritten URL, or the unchanged URL if no action was taken. */ public String processOutbound(final HttpServletRequest request, final HttpServletResponse response, final RewriteRule rule, final String url) { String result = url; if ((rule != null) && rule.isOutbound() && rule.matches(url)) { for (Processor p : processors) { result = p.processOutbound(request, response, rule, result); } } return result; }
/** * Rewrite the given URL using the provided {@link RewriteRule} object as a set of rules. * * @return The rewritten URL, or the unchanged URL if no action was taken. */ public String processInbound(final HttpServletRequest request, final HttpServletResponse response, final RewriteRule rule, final String url) { String result = url; if ((rule != null) && rule.isInbound() && rule.matches(url)) { for (Processor p : processors) { result = p.processInbound(request, response, rule, result); } } return result; }
private String rewrite(final String url) { String result = ""; if (url != null) { String strippedUrl = stripContextPath(url); if (!strippedUrl.equals(url)) { result = contextPath; } try { for (RewriteRule c : prettyConfig.getGlobalRewriteRules()) { strippedUrl = rewriteEngine.processOutbound(request, this, c, strippedUrl); } result += strippedUrl; } catch (Exception e) { throw new PrettyException("Error occurred during canonicalization of request <[" + url + "]>", e); } } return result; }
public String processOutbound(final HttpServletRequest request, final HttpServletResponse response, final RewriteRule rule, final String url) { String result = url; if (rule.getProcessor().length() > 0) { try { Class<?> processorClass = Class.forName(rule.getProcessor()); Processor processor = (Processor) processorClass.newInstance(); result = processor.processOutbound(request, response, rule, url); } catch (Exception e) { throw new PrettyException("Error occurred exececuting processor of type: " + rule.getProcessor() + ", for input URL <[" + url + "]>", e); } } return result; }
public String processInbound(final HttpServletRequest request, final HttpServletResponse response, final RewriteRule rule, final String url) { String result = url; if (rule.getProcessor().length() > 0) { try { Class<?> processorClass = Class.forName(rule.getProcessor()); Processor processor = (Processor) processorClass.newInstance(); result = processor.processInbound(request, response, rule, url); } catch (Exception e) { throw new PrettyException("Error occurred exececuting processor of type: " + rule.getProcessor() + ", for input URL <[" + url + "]>", e); } } return result; }
public String processOutbound(final HttpServletRequest request, final HttpServletResponse response, final RewriteRule rule, final String url) { String result = url; if (rule.getProcessor().length() > 0) { try { Class<?> processorClass = Class.forName(rule.getProcessor()); Processor processor = (Processor) processorClass.newInstance(); result = processor.processOutbound(request, response, rule, url); } catch (Exception e) { throw new PrettyException("Error occurred exececuting processor of type: " + rule.getProcessor() + ", for input URL <[" + url + "]>", e); } } return result; }
public String processInbound(final HttpServletRequest request, final HttpServletResponse response, final RewriteRule rule, final String url) { String result = url; if (rule.getProcessor().length() > 0) { try { Class<?> processorClass = Class.forName(rule.getProcessor()); Processor processor = (Processor) processorClass.newInstance(); result = processor.processInbound(request, response, rule, url); } catch (Exception e) { throw new PrettyException("Error occurred exececuting processor of type: " + rule.getProcessor() + ", for input URL <[" + url + "]>", e); } } return result; }
public String processOutbound(final HttpServletRequest request, final HttpServletResponse response, final RewriteRule rule, final String url) { String result = url; if (rule.getProcessor().length() > 0) { try { Class<?> processorClass = Class.forName(rule.getProcessor()); Processor processor = (Processor) processorClass.newInstance(); result = processor.processOutbound(request, response, rule, url); } catch (Exception e) { throw new PrettyException("Error occurred exececuting processor of type: " + rule.getProcessor() + ", for input URL <[" + url + "]>", e); } } return result; }
public String processInbound(final HttpServletRequest request, final HttpServletResponse response, final RewriteRule rule, final String url) { String result = url; if (rule.getProcessor().length() > 0) { try { Class<?> processorClass = Class.forName(rule.getProcessor()); Processor processor = (Processor) processorClass.newInstance(); result = processor.processInbound(request, response, rule, url); } catch (Exception e) { throw new PrettyException("Error occurred exececuting processor of type: " + rule.getProcessor() + ", for input URL <[" + url + "]>", e); } } return result; }
public String processOutbound(final HttpServletRequest request, final HttpServletResponse response, final RewriteRule rule, final String url) { String result = url; if (rule.getProcessor().length() > 0) { try { Class<?> processorClass = Class.forName(rule.getProcessor()); Processor processor = (Processor) processorClass.newInstance(); result = processor.processOutbound(request, response, rule, url); } catch (Exception e) { throw new PrettyException("Error occurred exececuting processor of type: " + rule.getProcessor() + ", for input URL <[" + url + "]>", e); } } return result; }
public String processInbound(final HttpServletRequest request, final HttpServletResponse response, final RewriteRule rule, final String url) { String result = url; if (rule.getProcessor().length() > 0) { try { Class<?> processorClass = Class.forName(rule.getProcessor()); Processor processor = (Processor) processorClass.newInstance(); result = processor.processInbound(request, response, rule, url); } catch (Exception e) { throw new PrettyException("Error occurred exececuting processor of type: " + rule.getProcessor() + ", for input URL <[" + url + "]>", e); } } return result; }