|
Home TOC |
|
The Example JSP Pages
This chapter illustrates JSTL with excerpts from the JSP version of the Duke's Bookstore application discussed in Custom Tags in JSP
Pages rewritten as follows:
- Replaced the Struts logic tags with JSTL core tags.
- Replaced scriptlets accessing a message store with message formatting tags.
- Removed the JavaBeans component database helper object and replaced its function 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
docs/tutorial/examples/web/bookstore4directory created when you unzip the tutorial bundle (see Running the Examples). To build, deploy, and run the example:
- Go to the examples directory and build and deploy the example by running
ant. This runs the default ant targetdeploywhich depends on thebuildtarget. Thebuildtarget will spawn any necessary compilations and copy files to thedocs/tutorial/examples/web/bookstore4/builddirectory. Thedeploytarget copies thebookstore4.xmlcontext file to<JWSDP_HOME>/webappsas described in Running Web Applications.- Start the Pointbase database server (see Accessing Databases from Web Applications).
- Start or restart Tomcat.
- Open the bookstore URL
http://localhost:8080/bookstore4/enter.See Common Problems and Their Solutions and Troubleshooting for help with diagnosing common problems.
|
Home TOC |
|