public void injectParameters(final FacesContext context) { log.trace("Injecting parameters"); PrettyContext prettyContext = PrettyContext.getCurrentInstance(context); URL url = prettyContext.getRequestURL(); UrlMapping mapping = prettyContext.getCurrentMapping(); if (mapping != null) { injectPathParams(context, url, mapping); injectQueryParams(context, mapping, prettyContext); } }
public void validateParameters(final FacesContext context) { log.trace("Validating parameters."); PrettyContext prettyContext = PrettyContext.getCurrentInstance(context); URL url = prettyContext.getRequestURL(); UrlMapping mapping = prettyContext.getCurrentMapping(); if (mapping != null) { validatePathParams(context, url, mapping); validateQueryParams(context, mapping); } }
@Override public boolean evaluate(final Rewrite event, final EvaluationContext ec) { PrettyContext context = PrettyContext.getCurrentInstance(((HttpServletRewrite) event).getRequest()); if ((event instanceof HttpInboundServletRewrite) && PFUtil.isMappingEnabled(event) && mapping.matches(context.getRequestURL())) { return true; } else if ((event instanceof HttpOutboundServletRewrite) && mapping.isOutbound()) { String outboundURL = ((HttpOutboundServletRewrite) event).getOutboundAddress().toString(); String contextPath = ((HttpServletRewrite) event).getContextPath(); if (!contextPath.equals("/") && outboundURL.startsWith(contextPath)) { outboundURL = outboundURL.substring(contextPath.length()); } return evaluateOutbound(outboundURL); } return false; }
/** * Handle DynaView processing. This method will end the Faces life-cycle. */ public void processDynaView(final PrettyContext prettyContext, final FacesContext facesContext) { log.trace("Requesting DynaView processing for: " + prettyContext.getRequestURL()); String viewId = ""; try { viewId = prettyContext.getCurrentViewId(); log.trace("Invoking DynaView method: " + viewId); Object result = computeDynaViewId(facesContext); if (result instanceof String) { viewId = (String) result; log.trace("Forwarding to DynaView: " + viewId); prettyContext.setDynaviewProcessed(true); facesContext.getExternalContext().dispatch(viewId); facesContext.responseComplete(); } } catch (Exception e) { log.error("Failed to process dynaview", e); PrettyRedirector prettyRedirector = new PrettyRedirector(); prettyRedirector.send404(facesContext); throw new PrettyException("Could not forward to view: " + viewId + "", e); } }
public void validateParameters(final FacesContext context) { log.trace("Validating parameters."); PrettyContext prettyContext = PrettyContext.getCurrentInstance(context); URL url = prettyContext.getRequestURL(); UrlMapping mapping = prettyContext.getCurrentMapping(); if (mapping != null) { validatePathParams(context, url, mapping); validateQueryParams(context, mapping); } }
/** * URL Tracking: */ public String getPageURLWithQueryString() { return PrettyContext.getCurrentInstance().getRequestURL().toURL() + PrettyContext.getCurrentInstance().getRequestQueryString().toQueryString(); }
public void validateParameters(final FacesContext context) { log.trace("Validating parameters."); PrettyContext prettyContext = PrettyContext.getCurrentInstance(context); URL url = prettyContext.getRequestURL(); UrlMapping mapping = prettyContext.getCurrentMapping(); if (mapping != null) { validatePathParams(context, url, mapping); validateQueryParams(context, mapping); } }
public void injectParameters(final FacesContext context) { log.trace("Injecting parameters"); PrettyContext prettyContext = PrettyContext.getCurrentInstance(context); URL url = prettyContext.getRequestURL(); UrlMapping mapping = prettyContext.getCurrentMapping(); if (mapping != null) { injectPathParams(context, url, mapping); injectQueryParams(context, mapping, prettyContext); } }
public void injectParameters(final FacesContext context) { log.trace("Injecting parameters"); PrettyContext prettyContext = PrettyContext.getCurrentInstance(context); URL url = prettyContext.getRequestURL(); UrlMapping mapping = prettyContext.getCurrentMapping(); if (mapping != null) { injectPathParams(context, url, mapping); injectQueryParams(context, mapping, prettyContext); } }
public void injectParameters(final FacesContext context) { log.trace("Injecting parameters"); PrettyContext prettyContext = PrettyContext.getCurrentInstance(context); URL url = prettyContext.getRequestURL(); UrlMapping mapping = prettyContext.getCurrentMapping(); if (mapping != null) { injectPathParams(context, url, mapping); injectQueryParams(context, mapping, prettyContext); } }
public void validateParameters(final FacesContext context) { log.trace("Validating parameters."); PrettyContext prettyContext = PrettyContext.getCurrentInstance(context); URL url = prettyContext.getRequestURL(); UrlMapping mapping = prettyContext.getCurrentMapping(); if (mapping != null) { validatePathParams(context, url, mapping); validateQueryParams(context, mapping); } }
@Override public String getActionURL(final FacesContext context, final String viewId) { PrettyContext prettyContext = PrettyContext.getCurrentInstance(context); if (prettyContext.isPrettyRequest() && !prettyContext.isInNavigation() && (viewId != null) && viewId.equals(context.getViewRoot().getViewId())) { URL url = prettyContext.getRequestURL(); QueryString query = prettyContext.getRequestQueryString(); String contextPath = prettyContext.getContextPath(); String target = contextPath + url + query.toQueryString(); return target; } else { return parent.getActionURL(context, viewId); } }
log.trace("Invoking method: " + action + ", on request: " + prettyContext.getRequestURL()); Object result = elUtils.invokeMethod(context, action.getAction().getELExpression()); if (result != null)
log.trace("Invoking method: " + action + ", on request: " + prettyContext.getRequestURL()); Object result = elUtils.invokeMethod(context, action.getAction().getELExpression()); if (result != null)
log.trace("Invoking method: " + action + ", on request: " + prettyContext.getRequestURL()); Object result = elUtils.invokeMethod(context, action.getAction().getELExpression()); if (result != null)
@Override public Map<String, String[]> getAdditionalParameters(final ServletRequest request, final ServletResponse response) { PrettyContext context = PrettyContext.getCurrentInstance((HttpServletRequest)request); PrettyConfig config = context.getConfig(); URL url = context.getRequestURL(); if (config.isURLMapped(url)) { List<PathParameter> params = context.getCurrentMapping().getPatternParser().parse(url); QueryString query = QueryString.build(params); return query.getParameterMap(); } return null; }
/** * Handle DynaView processing. This method will end the Faces life-cycle. */ public void processDynaView(final PrettyContext prettyContext, final FacesContext facesContext) { log.trace("Requesting DynaView processing for: " + prettyContext.getRequestURL()); String viewId = ""; try { viewId = prettyContext.getCurrentViewId(); log.trace("Invoking DynaView method: " + viewId); Object result = computeDynaViewId(facesContext); if (result instanceof String) { viewId = (String) result; log.trace("Forwarding to DynaView: " + viewId); prettyContext.setDynaviewProcessed(true); facesContext.getExternalContext().dispatch(viewId); facesContext.responseComplete(); } } catch (Exception e) { PrettyRedirector prettyRedirector = new PrettyRedirector(); prettyRedirector.send404(facesContext); throw new PrettyException("Could not forward to view: " + viewId + "", e); } }
/** * Handle DynaView processing. This method will end the Faces life-cycle. */ public void processDynaView(final PrettyContext prettyContext, final FacesContext facesContext) { log.trace("Requesting DynaView processing for: " + prettyContext.getRequestURL()); String viewId = ""; try { viewId = prettyContext.getCurrentViewId(); log.trace("Invoking DynaView method: " + viewId); Object result = computeDynaViewId(facesContext); if (result instanceof String) { viewId = (String) result; log.trace("Forwarding to DynaView: " + viewId); prettyContext.setDynaviewProcessed(true); facesContext.getExternalContext().dispatch(viewId); facesContext.responseComplete(); } } catch (Exception e) { log.error("Failed to process dynaview", e); PrettyRedirector prettyRedirector = new PrettyRedirector(); prettyRedirector.send404(facesContext); throw new PrettyException("Could not forward to view: " + viewId + "", e); } }
/** * Handle DynaView processing. This method will end the Faces life-cycle. */ public void processDynaView(final PrettyContext prettyContext, final FacesContext facesContext) { log.trace("Requesting DynaView processing for: " + prettyContext.getRequestURL()); String viewId = ""; try { viewId = prettyContext.getCurrentViewId(); log.trace("Invoking DynaView method: " + viewId); Object result = computeDynaViewId(facesContext); if (result instanceof String) { viewId = (String) result; log.trace("Forwarding to DynaView: " + viewId); prettyContext.setDynaviewProcessed(true); facesContext.getExternalContext().dispatch(viewId); facesContext.responseComplete(); } } catch (Exception e) { log.error("Failed to process dynaview", e); PrettyRedirector prettyRedirector = new PrettyRedirector(); prettyRedirector.send404(facesContext); throw new PrettyException("Could not forward to view: " + viewId + "", e); } }
REWRITE_MAPPING_ID_KEY + ":" + mapping.getId()); URL url = context.getRequestURL(); if (context.shouldProcessDynaview())