An instance of
Resource is a Java object representation of the artifact that is served up in response to a resource
request from the client. Instances of Resource are normally created and initialized via calls to
ResourceHandler#createResource. See the documentation for ResourceHandler for more information.
| Modifier and Type | Field and Description |
|---|---|
| public static final String | COMPONENT_RESOURCE_KEY
This constant is used as the key in the component attribute map of a composite component to associate the component
with its |
| private String | |
| private String | |
| private String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | Returns: the MIME content-type for this resource.Return the MIME content-type for this resource. |
| public abstract InputStream | Returns: anInputStream containing the bytes of the resource.
Any Jakarta Expression Language expressions present in the resource must be evaluated before serving the bytes of the resource. Note that due to browser and server caching, Jakarta Expression Language expressions in a resource file will generally only be evaluated once, when the resource is first served up. Therefore, using Jakarta Expression Language expressions that refer to per-request data is not advisable since this data can become stale.
If the current request is a resource request, (that is,
|
| public String | Returns: Return the libraryName for this resource. May benull.Return the libraryName for this resource. |
| public abstract String | Returns: the path to this resource, intended to be included in the encoded view that is sent to the browser when sending a faces response.Return a path to this resource such that, when the browser resolves it against the base URI for the view that includes the resource, and issues a GET request to the resultant fully qualified URL, the bytes of the resource are returned in response. |
| public String | Returns: Return the resourceName for this resource. Will never be null.Return the resourceName for this resource. |
| public abstract Map | Returns: a mutableMap<String, String> of headers that will be included with the response.
Returns a mutable |
| public abstract URL | Returns: Return an actualURL instance that refers to this resource instance.Implements abstract jakarta.
Return an actual |
| public void | setContentType(String
the MIME content-type for this resource. The default implementation must accept contentType)null
as a parameter.Set the MIME content-type for this resource. |
| public void | setLibraryName(String
the libraryName for this resource. The default implementation must accept libraryName)null for
the libraryName.Set the libraryName for this resource. |
| public void | |
| public String | Returns: Call through togetRequestPath and return the result.Overrides java.
Call through to |
| public abstract boolean | Returns: true or false depending on whether or not the user-agent needs an update of this
resource.the Faces context. context)
Return |
| COMPONENT_RESOURCE_KEY | back to summary |
|---|---|
| public static final String COMPONENT_RESOURCE_KEY
This constant is used as the key in the component attribute map of a composite component to associate the component
with its | |
| contentType | back to summary |
|---|---|
| private String contentType | |
| libraryName | back to summary |
|---|---|
| private String libraryName | |
| resourceName | back to summary |
|---|---|
| private String resourceName | |
| Resource | back to summary |
|---|---|
| public Resource() | |
| getContentType | back to summary |
|---|---|
| public String getContentType() Return the MIME content-type for this resource.
| |
| getInputStream | back to summary |
|---|---|
| public abstract InputStream getInputStream() throws IOException
If the current request is a resource request, (that is,
| |
| getLibraryName | back to summary |
|---|---|
| public String getLibraryName()
Return the libraryName for this resource. May be
| |
| getRequestPath | back to summary |
|---|---|
| public abstract String getRequestPath() Return a path to this resource such that, when the browser resolves it against the base URI for the view that includes the resource, and issues a GET request to the resultant fully qualified URL, the bytes of the resource are returned in response. The default implementation must implement the following algorithm. For discussion, the return result from this method will be called result.
| |
| getResourceName | back to summary |
|---|---|
| public String getResourceName()
Return the resourceName for this resource. Will never be null. All
| |
| getResponseHeaders | back to summary |
|---|---|
| public abstract Map
Returns a mutable | |
| getURL | back to summary |
|---|---|
| public abstract URL getURL() Implements abstract jakarta.
Return an actual | |
| setContentType | back to summary |
|---|---|
| public void setContentType(String contentType) Set the MIME content-type for this resource. The default implementation performs no validation on the argument.
| |
| setLibraryName | back to summary |
|---|---|
| public void setLibraryName(String libraryName) Set the libraryName for this resource.
| |
| setResourceName | back to summary |
|---|---|
| public void setResourceName(String resourceName) Set the resourceName for this resource.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java.
Call through to
| |
| userAgentNeedsUpdate | back to summary |
|---|---|
| public abstract boolean userAgentNeedsUpdate(FacesContext context)
Return
| |