June 8, 2009, 5:49 a.m.
posted by reo
The Example JSP PagesThis chapter describes the tasks involved in using and defining tags. The chapter illustrates the tasks with excerpts from the JSP version of the Duke's Bookstore application discussed in The Example JSP Pages (page 404) rewritten to take advantage of two tag libraries: Struts and tutorial-template. The third section in the chapter, Examples (page 453), describes two tags in detail: the iterate tag from Struts and the set of tags in the tutorial-template tag library. The Struts tag library provides a framework for building internationalized Web applications that implement the Model-View-Controller design pattern. Struts includes a comprehensive set of utility custom tags for handling:
The Duke's Bookstore application uses tags from the Struts bean and logicsublibraries. The tutorial-template tag library defines a set of tags for creating an application template. The template is a JSP page, with place holders for the parts that need to change with each screen. Each of these placeholders is referred to as a parameter of the template. For example, a simple template could include a title parameter for the top of the generated screen and a body parameter to refer to a JSP page for the custom content of the screen. The template is created with a set of nested tags— definition, screen, and parameter—that are used to build a table of screen definitions for Duke's Bookstore and an insert tag to insert parameters from the table into the screen. Figure shows the flow of a request through the Duke's Bookstore Web components: 1. Request Flow Through Duke's Bookstore Components![]()
The source for the Duke's Bookstore application is located in the docs/tutorial/examples/web/bookstore3 directory created when you unzip the tutorial bundle (see Running the Examples (page xx)). To build, deploy, and run the example:
See Common Problems and Their Solutions (page 65) and Troubleshooting (page 369) for help with diagnosing common problems. |
- Comment
