congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
ViewHandler.getResourceURL
Code IndexAdd Tabnine to your IDE (free)

How to use
getResourceURL
method
in
javax.faces.application.ViewHandler

Best Java code snippets using javax.faces.application.ViewHandler.getResourceURL (Showing top 20 results out of 513)

origin: primefaces/primefaces

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);
  }
}
origin: org.apache.shale/shale-tiles

/**
* <p>Pass through to the default view handler.</p>
* 
*/
public String getResourceURL(FacesContext context, String path) {
 return defaultViewHandler.getResourceURL(context, path);
}
 
origin: com.ocpsoft/prettyfaces-jsf2

@Override
public String getResourceURL(final FacesContext facesContext, final String path)
{
 return parent.getResourceURL(facesContext, path);
}
origin: org.ocpsoft.rewrite/rewrite-integration-faces

@Override
public String getResourceURL(final FacesContext facesContext, final String path)
{
 return parent.getResourceURL(facesContext, path);
}
origin: javax/javaee-web-api

/**
 * <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);
}
origin: com.sun.faces/jsf-api

/**
 * <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);
}
origin: org.apache.myfaces.core/myfaces-api

@Override
public String getResourceURL(FacesContext context, String path)
{
  return getWrapped().getResourceURL(context, path);
}
origin: org.jboss.spec.javax.faces/jboss-jsf-api_2.0_spec

/**
 * <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);
}
origin: org.apache.myfaces.tomahawk/tomahawk

/**
 * 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;
}
origin: org.icefaces/icefaces-ace

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 "";
  }
}

origin: javax.faces/javax.faces-api

/**
 * <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);
}
origin: org.icefaces/icefaces-ace

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);
}
origin: org.icefaces/icefaces-ace

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);
  }
}
 
origin: com.github.albfernandez.richfaces/richfaces-a4j

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);
}
origin: org.primefaces/primefaces

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);
  }
}
origin: javax.faces/jsf-impl

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));
}
origin: org.seasar.teeda/teeda-core

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;
}
origin: com.liferay.faces/liferay-faces-alloy

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;
}
origin: liferay/liferay-faces

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;
}
origin: org.apache.myfaces.core/myfaces-api

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)));
}

javax.faces.applicationViewHandlergetResourceURL

Javadoc

If the value returned from this method is used as the file argument to the four-argument constructor for java.net.URL (assuming appropriate values are used for the first three arguments), then a client making a request to the toExternalForm() of that URL will select the argument path for direct rendering. If the specified path starts with a slash, it must be treated as context relative; otherwise, it must be treated as relative to the action URL of the current view.

Popular methods of ViewHandler

  • getActionURL
    If the value returned from this method is used as the file argument to the four-argument constructor
  • createView
    Create and return a new UIViewRoot instance initialized with information from the argument FacesCont
  • restoreView
    Perform whatever actions are required to restore the view associated with the specified FacesContext
  • calculateRenderKitId
    Return an appropriate renderKitId for this and subsequent requests from the current client. It is an
  • calculateLocale
    Returns an appropriate Locale to use for this and subsequent requests for the current client.
  • writeState
    Take any appropriate action to either immediately write out the current state information (by callin
  • renderView
    Perform whatever actions are required to render the response view to the response object associated
  • initView
    Initialize the view for the request processing lifecycle. This method must be called at the beginni
  • getBookmarkableURL
    Return a JSF action URL derived from the viewId argument that is suitable to be used as the target
  • getViewDeclarationLanguage
    Return the ViewDeclarationLanguage instance used for this ViewHandler instance. The default impleme
  • getRedirectURL
    Return a JSF action URL derived from the viewId argument that is suitable to be used by the Navigat
  • calculateCharacterEncoding
    Returns the correct character encoding to be used for this request. The following algorithm is empl
  • getRedirectURL,
  • calculateCharacterEncoding,
  • deriveViewId,
  • deriveLogicalViewId,
  • getProtectedViewsUnmodifiable,
  • addProtectedView,
  • getViews,
  • getWebsocketURL,
  • removeProtectedView

Popular in Java

  • Updating database using SQL prepared statement
  • startActivity (Activity)
  • findViewById (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now