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.

Each taglib is different and will have different attributes and naming conventions.<br />

You will have to locate the documentation for the taglib you are using to find<br />

these. For this example, the documentation for the Mailer taglib can be located<br />

at:<br />

http://jakarta.apache.org/taglibs/doc/mailer-doc/mailer-1.1/index.html<br />

Figure 9-10 shows how tag libraries are used in a Web application.<br />

1<br />

2<br />

WEB-INF/lib/taglibs-mailer.jar<br />

...<br />

mail.class<br />

setrecipient.class<br />

from.class<br />

message.class<br />

send.class<br />

mailer.jsp<br />

<br />

or<br />

3<br />

taglib.tld<br />

...<br />

<br />

<br />

<br />

<br />

<br />

4<br />

Name:<br />

Message:<br />

<br />

web.xml<br />

<br />

<br />

http://jakarta.apache.org/taglibs/mailer-1.1<br />

/WEB-INF/lib/taglibs-mailer.jar<br />

<br />

Figure 9-10 Using custom tag libraries<br />

The Online Catalog application allows visitors to request information (or<br />

comment) about products by sending an e-mail. To do this, the application uses<br />

an HTML page called inforequest.html to solicit input from the user. It then calls<br />

mailer.jsp to retrieve the contents of the form and send an e-mail to the company<br />

using the Mailer taglib.<br />

302 <strong>IBM</strong> <strong>WebSphere</strong> <strong>Application</strong> <strong>Server</strong> - Express V5.0.2 Developer Handbook

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

Saved successfully!

Ooh no, something went wrong!