Book not found
Return to Documentation.
<?tablib uri="''myURI''" prefix="''my''"?>
This directive is used to load a taglib file, which defines a set of EL functions. The format of a taglib file is the same as that of JSP taglib files.
In the following example, we loads functions defined in the built-in TLD files identified as http://www.zkoss.org/dsp/web/core and then use one of these function called l.
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
<window title="${c:l('my.title')}">
...
</window>
Tip: ZK searches all TLD files defined in the /metainfo/tld/config.xml file from the classpath. If you want ZK to load your custom TLD files, add them to class path and then specify the following content in the /metainfo/tld/config.xml file.
<taglib> <taglib-uri>http://your-domain.com/your-path</taglib-uri> <taglib-location>/the/path/of/your/tld/file</taglib-location> </taglib>
If you want to load a TLD file from your Web application, you can specify the path as follows.
<?taglib uri="/WEB-INF/tld/my.tld" prefix="my"?>
Note
- taglib in zk aims to support EL functions only. It can't support tag from other library, such as spring security directly. There is a work around, you may use jsp to use tag from other library, and then use ZK-jsp to use it.
- Please refer to How to access static member field of a class in zul without zscript and Integrate with JSF, JSP and Others
uri
[Required][EL is ''not'' allowed]
A URL of the taglib file. Unlike other URL and URI, it doesn't interpret ~ or * specially. And, the page and the taglib files it references must be in the same Web application.
prefix
[Required]
A prefix used to identify functions defined in this taglib file. The prefix could be any non-empty string.
Version History
Version | Date | Content |
---|---|---|