Constructor and Description |
---|
JspFns() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
outDeviceCSSContent(javax.servlet.ServletContext ctx,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String deviceType)
Generates and returns the complete CSS content of all components in the
specified device.
|
static java.lang.String |
outDeviceJavaScripts(javax.servlet.ServletContext ctx,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String deviceType)
Returns HTML tags to include JavaScript files of the specified
device for the current application (never null).
|
static java.lang.String |
outDeviceStyleSheets(javax.servlet.ServletContext ctx,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String deviceType)
Returns HTML tags to include style sheets of the specified device
for the current application (never null).
|
static java.lang.String |
outZkHtmlTags(javax.servlet.ServletContext ctx,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String deviceType)
Generates and returns the ZK specific HTML tags such as stylesheet
and JavaScript.
|
static void |
setCacheControl(javax.servlet.http.HttpServletResponse response,
java.lang.String prop,
int hours)
Sets the Cache-Control, Expires, and Last-Modified headers for the response.
|
static boolean |
setCacheControl(javax.servlet.ServletContext context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String prop,
int hours)
Sets the Cache-Control, Expires, and Etag headers for the response.
|
static void |
setCSSCacheControl(javax.servlet.http.HttpServletResponse response)
Sets the Cache-Control, Expires, and Last-Modified headers for the CSS files
of class Web resources.
|
static boolean |
setCSSCacheControl(javax.servlet.ServletContext context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Sets the Cache-Control, Expires, and Etag headers for the CSS files
of class Web resources.
|
static void |
setCWRCacheControl(javax.servlet.http.HttpServletResponse response)
Sets the Cache-Control, Expires, and Last-Modified headers for class Web resources.
|
static boolean |
setCWRCacheControl(javax.servlet.ServletContext context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Sets the Cache-Control, Expires, and Etag headers for class Web resources.
|
public static java.lang.String outZkHtmlTags(javax.servlet.ServletContext ctx, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String deviceType)
deviceType
- the device type. If null, ajax is assumed.public static java.lang.String outDeviceCSSContent(javax.servlet.ServletContext ctx, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String deviceType)
Notice that it generates the content, while
outDeviceStyleSheets(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String)
generates the HTML tag that
will include the content.
public static final java.lang.String outDeviceStyleSheets(javax.servlet.ServletContext ctx, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String deviceType)
This method is used for JSP pages.
deviceType
- the device type. If null, ajax is assumed.public static final java.lang.String outDeviceJavaScripts(javax.servlet.ServletContext ctx, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String deviceType)
public static void setCacheControl(javax.servlet.http.HttpServletResponse response, java.lang.String prop, int hours)
Last-Modified is a "weak" caching header in that the browser applies
a heuristic to determine whether to fetch the item from cache or not. Use
setCacheControl(ServletContext, HttpServletRequest, HttpServletResponse, String, int)
instead.
response
- the servlet response (never null)prop
- the name of the property to check if the headers
shall be generated. If null, it is always generated.
If "false" is specified with this property, this method won't
generate anything. In other words, "false" means to disable the cache.
If It is used for debugging/developing purpose.hours
- the number of hours the client is allowed to cache the
resourcesetCacheControl(ServletContext, HttpServletRequest, HttpServletResponse, String, int)
public static boolean setCacheControl(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String prop, int hours)
context
- the servlet context (never null)request
- the servlet request (never null)response
- the servlet response (never null)prop
- the name of the propery to check if the headers
shall be generated. If null, it is always generated.
If "false" is specified with this property, this method won't
generate anything. In other words, "false" means to disable the cache.
If It is used for debugging/developing purpose.hours
- the number of hours the client is allowed to cache the
resourcepublic static void setCSSCacheControl(javax.servlet.http.HttpServletResponse response)
Last-Modified is a "weak" caching header in that the browser applies
a heuristic to determine whether to fetch the item from cache or not. Use
setCSSCacheControl(ServletContext, HttpServletRequest, HttpServletResponse)
instead.
It first check if org.zkoss.web.classWebResource.cache is turned off, and then check how many hours specified in org.zkoss.web.classWebResource.cache.CSS.hours. If it is turned off or the value of hours is non-positive, nothing is generated Otherwise, it generates the header with the specified hours (default: 8760).
public static boolean setCSSCacheControl(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
It first check if org.zkoss.web.classWebResource.cache is turned off, and then check how many hours specified in org.zkoss.web.classWebResource.cache.CSS.hours. If it is turned off or the value of hours is non-positive, nothing is generated Otherwise, it generates the header with the specified hours (default: 8760).
setCWRCacheControl(ServletContext, HttpServletRequest, HttpServletResponse)
public static void setCWRCacheControl(javax.servlet.http.HttpServletResponse response)
Last-Modified is a "weak" caching header in that the browser applies
a heuristic to determine whether to fetch the item from cache or not. Use
setCWRCacheControl(ServletContext, HttpServletRequest, HttpServletResponse)
instead.
It checks if org.zkoss.web.classWebResource.cache
is turned off. If not, it generates the headers.
Notice that, for the CSS files, please use setCSSCacheControl(javax.servlet.http.HttpServletResponse)
instead.
public static boolean setCWRCacheControl(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Notice that, for the CSS files, please use setCSSCacheControl(javax.servlet.http.HttpServletResponse)
instead.
Copyright © 2005-2018 Potix Corporation. All Rights Reserved.