Download
FAQ
History
PrevHomeNext API
Search
Feedback
Divider

The Example JSP Pages

This chapter illustrates JSTL with excerpts from the JSP version of the Duke's Bookstore application discussed in Chapter 16 rewritten to replace the JavaBeans component database helper object with direct calls to the database via the JSTL SQL tags. For most applications, it is better to encapsulate calls to a database in a bean. JSTL includes SQL tags for situations where a new application is being prototyped and the overhead of creating a bean may not be warranted.

The source for the Duke's Bookstore application is located in the <INSTALL>/jwstutorial13/examples/web/bookstore4/ directory created when you unzip the tutorial bundle (see About the Examples). A sample bookstore4.war is provided in <INSTALL>/jwstutorial13/examples/web/provided-wars/. To build, package, deploy, and run the example:

  1. Build and package the bookstore common files as described in Duke's Bookstore Examples (page 89).
  2. In a terminal window, go to <INSTALL>/jwstutorial13/examples/web/bookstore4/.
  3. Run ant copy. This target will copy files to the <INSTALL>/jwstutorial13/examples/web/bookstore4/build/ directory.
  4. Start Tomcat.
  5. Perform all the operations described in Accessing Databases from Web Applications, page 89.
  6. Run ant install-config. The install-config target notifies Tomcat that the new context is available. See Installing Web Applications (page 78).
  7. Open the bookstore URL http://localhost:8080/bookstore4/bookstore.

See Troubleshooting (page 616) for help with diagnosing common problems.

Divider
Download
FAQ
History
PrevHomeNext API
Search
Feedback
Divider

All of the material in The Java(TM) Web Services Tutorial is copyright-protected and may not be published in other works without express written permission from Sun Microsystems.