public static String getResourceURL(FacesContext context, String value) { if (LangUtils.isValueBlank(value)) { return Constants.EMPTY_STRING; } else if (value.contains(ResourceHandler.RESOURCE_IDENTIFIER)) { return value; } else { String url = context.getApplication().getViewHandler().getResourceURL(context, value); return context.getExternalContext().encodeResourceURL(url); } }
/** * <p>Pass through to the default view handler.</p> * */ public String getResourceURL(FacesContext context, String path) { return defaultViewHandler.getResourceURL(context, path); }
@Override public String getResourceURL(final FacesContext facesContext, final String path) { return parent.getResourceURL(facesContext, path); }
@Override public String getResourceURL(final FacesContext facesContext, final String path) { return parent.getResourceURL(facesContext, path); }
/** * <p>The default behavior of this method is to * call {@link ViewHandler#getResourceURL(javax.faces.context.FacesContext, String)} * on the wrapped {@link ViewHandler} object.</p> * * @see ViewHandler#getResourceURL(javax.faces.context.FacesContext, String) * @since 1.2 */ @Override public String getResourceURL(FacesContext context, String path) { return getWrapped().getResourceURL(context, path); }
/** * <p>The default behavior of this method is to * call {@link ViewHandler#getResourceURL(javax.faces.context.FacesContext, String)} * on the wrapped {@link ViewHandler} object.</p> * * @see ViewHandler#getResourceURL(javax.faces.context.FacesContext, String) * @since 1.2 */ @Override public String getResourceURL(FacesContext context, String path) { return getWrapped().getResourceURL(context, path); }
@Override public String getResourceURL(FacesContext context, String path) { return getWrapped().getResourceURL(context, path); }
/** * <p>The default behavior of this method is to * call {@link ViewHandler#getResourceURL(javax.faces.context.FacesContext, String)} * on the wrapped {@link ViewHandler} object.</p> * * @see ViewHandler#getResourceURL(javax.faces.context.FacesContext, String) * @since 1.2 */ public String getResourceURL(FacesContext context, String path) { return getWrapped().getResourceURL(context, path); }
/** * Get the Path used to retrieve an resource. */ public String getResourceUri(FacesContext context, String uri, boolean withContextPath) { if (withContextPath) { return context.getApplication().getViewHandler().getResourceURL(context, uri); } return uri; }
public static String processStaticSrc(FacesContext facesContext, Object o, String url) { String value = o != null ? String.valueOf(o) : null; // support url as an alias for value if (value == null || "".equals(value)) { value = url; } if (value != null && !"".equals(value)) { return facesContext.getApplication().getViewHandler().getResourceURL(facesContext, value); } else { return ""; } }
/** * <p>The default behavior of this method is to * call {@link ViewHandler#getResourceURL(javax.faces.context.FacesContext, String)} * on the wrapped {@link ViewHandler} object.</p> * * @see ViewHandler#getResourceURL(javax.faces.context.FacesContext, String) * @since 1.2 */ @Override public String getResourceURL(FacesContext context, String path) { return getWrapped().getResourceURL(context, path); }
public static String resolveResourceURL(FacesContext facesContext, String path) { ExternalContext ec = facesContext.getExternalContext(); String ctxtPath = ec.getRequestContextPath(); if (path.length() > 0 && path.charAt(0) == '/' && path.startsWith(ctxtPath)) { path = path.substring(ctxtPath.length()); } return facesContext.getApplication().getViewHandler().getResourceURL(facesContext, path); }
protected String getResourceURL(FacesContext facesContext, String value) { if (value.contains(ResourceHandler.RESOURCE_IDENTIFIER)) { return value; } else { String url = facesContext.getApplication().getViewHandler().getResourceURL(facesContext, value); return facesContext.getExternalContext().encodeResourceURL(url); } }
public static String getResourceURL(String url, FacesContext context) { if (null == url) { return null; } Application application = context.getApplication(); ExternalContext externalContext = context.getExternalContext(); String value = url; if (value.length() == 0 || value.charAt(0) != '/' || !value.startsWith(externalContext.getRequestContextPath())) { value = application.getViewHandler().getResourceURL(context, value); } return externalContext.encodeResourceURL(value); }
public static String getResourceURL(FacesContext context, String value) { if (isValueBlank(value)) { return Constants.EMPTY_STRING; } else if (value.contains(ResourceHandler.RESOURCE_IDENTIFIER)) { return value; } else { String url = context.getApplication().getViewHandler().getResourceURL(context, value); return context.getExternalContext().encodeResourceURL(url); } }
private static String src(FacesContext context, UIComponent component) { String value = (String) ((UIGraphic) component).getValue(); if (value == null) { return ""; } value = context.getApplication().getViewHandler(). getResourceURL(context, value); return (context.getExternalContext().encodeResourceURL(value)); }
protected String getUrl(FacesContext context, UIGraphic htmlGraphicImage) { String url = htmlGraphicImage.getUrl(); if (url == null) { url = ""; } url = FacesContextUtil.getViewHandler(context).getResourceURL(context, url); url = context.getExternalContext().encodeResourceURL(url); return url; }
private String getEncodedResourceURL(FacesContext facesContext, ResourceHandler resourceHandler, Application application, String name) { String encodedResourceURL = name; if (!isFacesResourceURL(resourceHandler, name)) { ViewHandler viewHandler = application.getViewHandler(); String resourceURL = viewHandler.getResourceURL(facesContext, name); ExternalContext externalContext = facesContext.getExternalContext(); encodedResourceURL = externalContext.encodeResourceURL(resourceURL); } return encodedResourceURL; }
private String getEncodedResourceURL(FacesContext facesContext, ResourceHandler resourceHandler, Application application, String name) { String encodedResourceURL = name; if (!isFacesResourceURL(resourceHandler, name)) { ViewHandler viewHandler = application.getViewHandler(); String resourceURL = viewHandler.getResourceURL(facesContext, name); ExternalContext externalContext = facesContext.getExternalContext(); encodedResourceURL = externalContext.encodeResourceURL(resourceURL); } return encodedResourceURL; }
public URL getResourceURL(FacesContext context) throws MalformedURLException { ExternalContext externalContext = context.getExternalContext(); return new URL(externalContext.getRequestScheme(), externalContext.getRequestServerName(), externalContext.getRequestServerPort(), context.getApplication().getViewHandler().getResourceURL(context, getToViewId(context))); }