10.12.2012 Views

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

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.

<strong>The</strong> template is a JSP page that has placeholders for the parts that need to change with each<br />

screen. Each of these placeholders is referred to as a parameter of the template. For example, a<br />

simple template might include a title parameter for the top of the generated screen and a body<br />

parameter to refer to a JSP page for the custom content of the screen.<br />

<strong>The</strong> template uses a set of nested tags (definition, screen, and parameter) to define a table of<br />

screen definitions and uses an insert tag to insert parameters from a screen definition into a<br />

specific application screen.<br />

JSP Pages<br />

<strong>The</strong> template for the Duke’s Bookstore example,<br />

tut-install/javaeetutorial5/examples/web/bookstore3/web/template/template.jsp,is<br />

shown next. This page includes a JSP page that creates the screen definition and then uses the<br />

insert tag to insert parameters from the definition into the application screen.<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

Copyright &copy; 2004 Sun Microsystems, Inc. <br />

<br />

<br />

<strong>The</strong><br />

tut-install/javaeetutorial5/examples/web/bookstore3/web/template/screendefinitions.jspf<br />

page creates a definition for the screen specified by the request attribute<br />

javax.servlet.forward.servlet_path:<br />

<br />

<br />

<br />

<br />

<br />

Programming SimpleTag Handlers<br />

Chapter 8 • CustomTags in JSP Pages 265

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

Saved successfully!

Ooh no, something went wrong!