29.01.2013 Views

WebSphere Application Server - IBM Redbooks

WebSphere Application Server - IBM Redbooks

WebSphere Application Server - IBM Redbooks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Invoking the taglib within the application<br />

To continue the example of the hello tag, we have seen that the tag accepts one<br />

attribute, called name. The syntax of the tag is:<br />

<br />

The code used to invoke the tag is shown in Example 9-5. First, the taglib is<br />

declared with a taglib directive, giving it a prefix, book, which we will use to<br />

identify the tags. Then the prefix is used to invoke the taglib function.<br />

Example 9-5 Simple custom tag example: helloSample.html<br />

<br />

<br />

<br />

<br />

Simple custom tag example<br />

<br />

<br />

<br />

Simple custom tag example.<br />

<br />

<br />

<br />

The result of executing the HTML is shown in Figure 9-1.<br />

Figure 9-1 Simple custom tag example: Results<br />

Chapter 9. Using tag libraries 287

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!