| java.lang.Object org.zkoss.web.util.resource.ResourceCaches
ResourceCaches | public class ResourceCaches (Code) | | Utilities to load (and parse) the servlet resource.
Usage 1:
- Use
ResourceCaches.getContent to load the resource into a String-type content.
Usage 2:
- Implements a loader by extending from
ResourceLoader .
- Creates a resource cache (
ResourceCache )
by use of the loader in the previous step.
- Invoke
ResourceCaches.get to load the resource.
Usage 2 has better performance because you need to parse the content
only once. Usage 1 is simple if you don't pase it into any intermediate
format.
author: tomyeh |
getContent | final public static String getContent(ServletContext ctx, String path)(Code) | | Returns the content of the specified path, or null if not found.
The content is returned directly as a string without any parsing.
Note: the encoding is assumed to be "UTF-8".
Parameters: path - the URI path |
|
|