taglib"

From Documentation
m (Created page with "{{ZESTEssentialsPageHeader}} =Version History= {{LastUpdated}} {| border='1px' | width="100%" ! Version !! Date !! Content |- |   |   |   |} {{ZESTEssentialsPage...")
 
m (correct highlight (via JWB))
 
(4 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
{{ZESTEssentialsPageHeader}}
 
{{ZESTEssentialsPageHeader}}
 +
 +
__NOTOC__
 +
 +
'''Syntax:'''
 +
<tablib uri="''myURI''" prefix="''my''"/>
 +
 +
It 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 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/toLowerCase|the toLowerCase function]].
 +
 +
<source lang="xml" >
 +
<taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"/>
 +
<action pattern="/hello" method="c:toLowerCase(request.method)" class="foo.Hello">
 +
...
 +
</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" >
 +
<taglib uri="/WEB-INF/tld/my.tld" prefix="my"/>
 +
</source>
 +
 +
For more information about the syntax of a custom taglib, please refer to [[ZUML Reference/ZUML/Processing Instructions/taglib/Custom Taglib|ZUML Reference]].
 +
 +
If you'd like to define a couple of EL functions, you could use [[ZEST Essentials/Configuration/zest.xml/xel-method|the xel-method element]] instead.
 +
 +
=Attributes=
 +
==The uri Attribute==
 +
 +
[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.
 +
 +
== The prefix Attribute ==
 +
 +
[Required]
 +
 +
A prefix used to identify functions defined in this <code>taglib</code> file. The prefix could be any non-empty string.
  
 
=Version History=
 
=Version History=

Latest revision as of 02:57, 18 January 2022



Syntax:

<tablib uri="myURI" prefix="my"/>

It 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 functions defined in the built-in TLD files identified as http://www.zkoss.org/dsp/web/core, and then use the toLowerCase function.

<taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"/>
<action pattern="/hello" method="c:toLowerCase(request.method)" class="foo.Hello"> 
...

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"/>

For more information about the syntax of a custom taglib, please refer to ZUML Reference.

If you'd like to define a couple of EL functions, you could use the xel-method element instead.

Attributes

The uri Attribute

[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.

The prefix Attribute

[Required]

A prefix used to identify functions defined in this taglib file. The prefix could be any non-empty string.

Version History

Last Update : 2022/01/18


Version Date Content
     



Last Update : 2022/01/18

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.