Today, Budi walks us through a refresher and brief overview of server JSP programming. Today's portion covers JavaServer Pages (JSP), with a thorough overview of JavaBeans and Tags. This excerpt comes from chapter one of JavaServer Faces Programming, by Budi Kurniawan (McGraw-Hill/Osborne, ISBN 0-07-222983-7, 2004).
The uri attribute specifies an absolute or relative URI that uniquely identifies the TLD associated with this prefix. The prefix attribute defines a string that will become the prefix to distinguish a custom action.
With a taglib directive, you can use a custom tag of the following format for a custom tag that does not have a content body:
Or, you can use the following format for a custom tag that has a content body:
You can pass attributes to the tag handler by specifying the attributes in the custom tag, each with the following format:
The following example is a custom tag whose prefix is m and whose name is myTag. The tag has two attributes: number, with a value of 12, and power, with a value of 13.
<m:myTag number="12" power="13"/>
Note that an attribute value must be enclosed in quotation marks.