taglib"
Maya001122 (talk | contribs) m |
m (correct highlight (via JWB)) |
||
(12 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | {{ | + | {{ZUMLReferencePageHeader}} |
− | + | '''Syntax:''' | |
− | |||
<?tablib uri="''myURI''" prefix="''my''"?> | <?tablib uri="''myURI''" prefix="''my''"?> | ||
− | |||
− | This directive is used to load a < | + | This directive is used to load a <code>taglib</code> file, which defines a set of static methods that can be used in EL expressions (so called EL functions). |
− | + | For example, we could load the functions defined in the built-in TLD files identified as [[ZUML Reference/EL Expressions/Core Methods|http://www.zkoss.org/dsp/web/core]], and then use [[ZUML Reference/EL Expressions/Core Methods/l|the l function]]. | |
<source lang="xml" > | <source lang="xml" > | ||
Line 17: | Line 15: | ||
</source> | </source> | ||
− | + | If you want to load a TLD file from your Web application, you can specify the path directly. For example, suppose you have a custom TLD at <code>/WEB-INF/tld/my.tld</code>, then you could specify it as follows. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | </ | ||
− | |||
− | |||
− | |||
− | |||
<source lang="xml" > | <source lang="xml" > | ||
<?taglib uri="/WEB-INF/tld/my.tld" prefix="my"?> | <?taglib uri="/WEB-INF/tld/my.tld" prefix="my"?> | ||
+ | <listbox> | ||
+ | <listitem label="${each.name}" forEach="${my:getCustomers()}"/> | ||
+ | <!-- assume there is a function called getCustomers --> | ||
+ | </listbox> | ||
</source> | </source> | ||
− | + | The syntax of a taglib document is described in the subsection: | |
− | + | {{ZUMLReferenceHeadingToc}} | |
− | |||
− | + | = uri = | |
− | + | [Required][EL is ''not'' allowed] | |
− | [Required][EL is ''not'' allowed] | + | |
− | </ | + | A URL of the <code>taglib</code> file. Unlike other URL and URI, it doesn't interpret ~ or * specially. And, the page and the <code>taglib</code> files it references must be in the same Web application. |
− | + | = prefix = | |
− | + | [Required] | |
− | < | + | A prefix is used to identify functions defined in this <code>taglib</code> file. The prefix could be any non-empty strings. |
− | |||
− | </ | ||
− | + | =Version History= | |
− | ==Version | + | {| border='1px' | width="100%" |
+ | ! Version !! Date !! Content | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | |} | ||
− | {{ | + | {{ZUMLReferencePageFooter}} |
Latest revision as of 13:28, 19 January 2022
Syntax:
<?tablib uri="myURI" prefix="my"?>
This directive is used to load a taglib
file, which defines a set of static methods that can be used in EL expressions (so called EL functions).
For example, we could load the functions defined in the built-in TLD files identified as http://www.zkoss.org/dsp/web/core, and then use the l function.
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
<window title="${c:l('my.title')}">
...
</window>
If you want to load a TLD file from your Web application, you can specify the path directly. For example, suppose you have a custom TLD at /WEB-INF/tld/my.tld
, then you could specify it as follows.
<?taglib uri="/WEB-INF/tld/my.tld" prefix="my"?>
<listbox>
<listitem label="${each.name}" forEach="${my:getCustomers()}"/>
<!-- assume there is a function called getCustomers -->
</listbox>
The syntax of a taglib document is described in the subsection:
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 is used to identify functions defined in this taglib
file. The prefix could be any non-empty strings.
Version History
Version | Date | Content |
---|---|---|