com.sun.faces.facelets.util
public final class Resource extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static java.util.logging.Logger |
log |
Constructor and Description |
---|
Resource() |
Modifier and Type | Method and Description |
---|---|
static java.net.URL |
getResourceUrl(javax.faces.context.FacesContext ctx,
java.lang.String path)
Get an URL of an internal resource.
|
private static java.net.URL |
getUrlForResourceAsStream(javax.faces.context.ExternalContext externalContext,
java.lang.String path) |
private static boolean |
resourceExist(javax.faces.context.ExternalContext externalContext,
java.lang.String path) |
public static java.net.URL getResourceUrl(javax.faces.context.FacesContext ctx, java.lang.String path) throws java.net.MalformedURLException
ExternalContext.getResource(String)
is
checked for an non-null URL return value. In the case of a null return
value (as it is the case for Weblogic 8.1 for a packed war), a URL with a
special URL handler is constructed, which can be used for
opening a serlvet resource later. Internally, this special URL
handler will call ServletContext.getResourceAsStream(String)
when
an inputstream is requested. This works even on Weblogic 8.1ctx
- the faces context from which to retrieve the resourcepath
- an URL pathjava.net.MalformedURLException
private static boolean resourceExist(javax.faces.context.ExternalContext externalContext, java.lang.String path)
private static java.net.URL getUrlForResourceAsStream(javax.faces.context.ExternalContext externalContext, java.lang.String path) throws java.net.MalformedURLException
java.net.MalformedURLException
Copyright © 2002-2010 Oracle America, Inc. All Rights Reserved.