/** * Return a String representation of this URL */ @Override public String toString() { return toURL(); }
/** * Return a String representation of this URL */ @Override public String toString() { return toURL(); }
/** * Return a String representation of this URL */ @Override public String toString() { return toURL(); }
/** * Return a String representation of this URL */ @Override public String toString() { return toURL(); }
@Override public boolean evaluate(final Rewrite event, final EvaluationContext context) { if ((event instanceof HttpOutboundServletRewrite) && rule.isOutbound()) { Address outboundResource = ((HttpOutboundServletRewrite) event).getAddress(); String outboundUrl = outboundResource.toString(); String contextPath = ((HttpServletRewrite) event).getContextPath(); if (!contextPath.equals("/") && outboundUrl.startsWith(contextPath)) outboundUrl = outboundUrl.substring(contextPath.length()); if (rule.matches(URL.build(outboundUrl).decode().toURL())) return true; } return false; }
/** * Search through all currently configured {@link UrlMapping} objects for the first one that matches the given URL. * * @return the first appropriate {@link UrlMapping} for a given URL. */ public UrlMapping getMappingForUrl(final URL url) { final String mappingKey = url.toURL(); if (cachedMappings.containsKey(mappingKey)) { return cachedMappings.get(mappingKey); } for (UrlMapping mapping : getMappings()) { if (mapping.matches(url)) { if (!mapping.getPatternParser().isElPattern()) { cachedMappings.put(mappingKey, mapping); } return mapping; } } return null; }
/** * Search through all currently configured {@link UrlMapping} objects for the first one that matches the given URL. * * @return the first appropriate {@link UrlMapping} for a given URL. */ public UrlMapping getMappingForUrl(final URL url) { final String mappingKey = url.toURL(); if (cachedMappings.containsKey(mappingKey)) { return cachedMappings.get(mappingKey); } for (UrlMapping mapping : getMappings()) { if (mapping.matches(url)) { if (!mapping.getPatternParser().isElPattern()) { cachedMappings.put(mappingKey, mapping); } return mapping; } } return null; }
/** * Search through all currently configured {@link UrlMapping} objects for the first one that matches the given URL. * * @return the first appropriate {@link UrlMapping} for a given URL. */ public UrlMapping getMappingForUrl(final URL url) { final String mappingKey = url.toURL(); if (cachedMappings.containsKey(mappingKey)) { return cachedMappings.get(mappingKey); } for (UrlMapping mapping : getMappings()) { if (mapping.matches(url)) { if (!mapping.getPatternParser().isElPattern()) { cachedMappings.put(mappingKey, mapping); } return mapping; } } return null; }
/** * Search through all currently configured {@link UrlMapping} objects for the first one that matches the given URL. * * @return the first appropriate {@link UrlMapping} for a given URL. */ public UrlMapping getMappingForUrl(final URL url) { final String mappingKey = url.toURL(); if (cachedMappings.containsKey(mappingKey)) { return cachedMappings.get(mappingKey); } for (UrlMapping mapping : getMappings()) { if (mapping.matches(url)) { if (!mapping.getPatternParser().isElPattern()) { cachedMappings.put(mappingKey, mapping); } return mapping; } } return null; }
/** * URL Tracking: */ public String getPageURLWithQueryString() { return PrettyContext.getCurrentInstance().getRequestURL().toURL() + PrettyContext.getCurrentInstance().getRequestQueryString().toQueryString(); }
@Override public boolean evaluate(final Rewrite event, final EvaluationContext context) { if (event instanceof HttpInboundServletRewrite && rule.isInbound() && PFUtil.isRewritingEnabled(event)) { HttpServletRewrite httpRewrite = (HttpServletRewrite) event; String path = httpRewrite.getInboundAddress().getPath(); String url = URL.build(path).decode().toURL() + QueryString.build(httpRewrite.getInboundAddress().getQuery()).toQueryString(); String contextPath = httpRewrite.getContextPath(); if (!contextPath.equals("/") && url.startsWith(contextPath)) url = url.substring(contextPath.length()); if (rule.matches(url)) { return true; } } return false; }
if (context.shouldProcessDynaview()) log.trace("Forwarding mapped request [" + url.toURL() + "] to dynaviewId [" + context.getDynaViewId() + "]"); ((HttpInboundServletRewrite) event).forward(context.getDynaViewId()); log.trace("Forwarding mapped request [" + url.toURL() + "] to resource [" + viewId + "]"); if (url.toURL().equals(viewId))
String originalUrl = httpRewrite.getInboundAddress().getPath(); originalUrl = URL.build(originalUrl).decode().toURL() + QueryString.build(httpRewrite.getInboundAddress().getQuery()).toQueryString();