Package org.zkoss.web.util.resource
Class ResourceCaches
java.lang.Object
org.zkoss.web.util.resource.ResourceCaches
Utilities to load (and parse) the Servlet resource.
Notice that
ResourceCache and ResourceLoader
must be used rather than
ResourceCache
and Loader.
Usage:
- Implements a loader by extending from
ResourceLoader. - Creates a resource cache (
ResourceCache) by use of the loader in the previous step. - Invoke
get(org.zkoss.web.util.resource.ResourceCache<V>, jakarta.servlet.ServletContext, java.lang.String, java.lang.Object)to load the resource.
- Author:
- tomyeh
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final <V> Vget(ResourceCache<V> cache, jakarta.servlet.ServletContext ctx, String path, Object extra) Loads, parses and returns the resource of the specified URI, or null if not found.
-
Constructor Details
-
ResourceCaches
public ResourceCaches()
-
-
Method Details
-
get
public static final <V> V get(ResourceCache<V> cache, jakarta.servlet.ServletContext ctx, String path, Object extra) Loads, parses and returns the resource of the specified URI, or null if not found. The parser is defined by the loader defined inResourceCache.- Parameters:
cache- the resource cache. Note: its loader must extend fromResourceLoader.path- the URI pathextra- the extra parameter that will be passed toResourceLoader.parse(String,File,Object)andResourceLoader.parse(String,URL,Object)
-