Package org.zkoss.zk.fn
Class DspFns
java.lang.Object
org.zkoss.zk.fn.DspFns
Utilities to generate ZK related information in DSP pages.
For JSP pages, use JspFns instead.
For ZUML pages, use ZkFns instead.
- Since:
- 3.5.2
- Author:
- tomyeh
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringoutDeviceCSSContent(String deviceType) Generates the complete CSS content of all components in the specified device.static final StringoutDeviceJavaScripts(String deviceType) Returns HTML tags to include JavaScript files of the specified device for the current application (never null).static final StringoutDeviceStyleSheets(String deviceType) Returns HTML tags to include style sheets of the specified device for the current application (never null).static StringoutZkHtmlTags(String deviceType) Generates and returns the ZK specific HTML tags such as stylesheet and JavaScript.static voidsetCacheControl(String prop, int hours) Sets the Cache-Control and Expires headers for the response.static voidSets the Cache-Control and Expires headers for the CSS files of class Web resources.static voidSets the Cache-Control and Expires headers for class Web resources.
-
Constructor Details
-
DspFns
public DspFns()
-
-
Method Details
-
outZkHtmlTags
Generates and returns the ZK specific HTML tags such as stylesheet and JavaScript. If you want to generate HTML HEAD and BODY tags by yourself in a non-ZUML page (DSP), you can invoke this method at the location you want (such as inside the HTML HEAD tag).- Parameters:
deviceType- the device type. If null, ajax is assumed.- Returns:
- the string holding the HTML tags, or null if already generated.
-
outDeviceCSSContent
Generates the complete CSS content of all components in the specified device.Notice that it generates the content, while
outDeviceStyleSheets(java.lang.String)generates the HTML tag that will include the content.- Since:
- 5.0.0
-
outDeviceStyleSheets
Returns HTML tags to include style sheets of the specified device for the current application (never null).This method is used for DSP pages.
- Parameters:
deviceType- the device type. If null, ajax is assumed.
-
outDeviceJavaScripts
Returns HTML tags to include JavaScript files of the specified device for the current application (never null).- Since:
- 5.0.0
-
setCacheControl
Sets the Cache-Control and Expires headers for the response.- Parameters:
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 resource- Since:
- 3.6.3
-
setCSSCacheControl
public static void setCSSCacheControl()Sets the Cache-Control and Expires headers for the CSS files of class Web resources.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).
- Since:
- 3.6.3
- See Also:
-
setCWRCacheControl
public static void setCWRCacheControl()Sets the Cache-Control and Expires headers for class Web resources. 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()instead.- Since:
- 3.6.3
-