Web Development with JavaServer Pages

Скачать в pdf «Web Development with JavaServer Pages»

An example JSPproject

This chapter covers

■    Building a servlet-centric application

■    Component-based JSP development

■    JSP/Database interaction

■    Utilizing the command pattern

■    Maintaining transaction integrity

Now we will apply the JSP programming techniques covered in previous chapters toward the design and development of a real-world enterprise application more complex than would be allowed as part of another chapter. We will develop a database driven system for creating, managing, and displaying a list of frequently asked questions (FAQs) and making them available through a web site. We hope it will help tie together all the concepts we have discussed so far.

11.1    An FAQ system

We selected an FAQ system as the example for this chapter for several reasons. It is a nontrivial application that illustrates many of the principals of JSP application design such as command handling, form element processing, database interaction, and transaction management. It was also important to present an application simple enough that it could be constrained to a readable number of pages.

Lastly, we wanted to end up with a web application that could be useful in its own right. While we will approach this project from an FAQ perspective, the project itself is applicable to maintaining and displaying any collection of information managed by a database through a browser with JSP. Just to show you where we are heading, a screen shot of the finished application in action is shown in
figure 11.1.

11.1.1    Project motivations

A recent client of ours has been maintaining a list of FAQs to address common customer product issues. As the list has grown over the years it had became increasingly difficult to maintain and it had become necessary to maintain several different ver-sions—a table of contents view, the whole list view, a list of new entries sorted by date, and so forth. Each version was maintained by hand from the master list. The web content team was responsible for updating the HTML based on the input of product management, technical support, the documentation team, and a host of others.

Скачать в pdf «Web Development with JavaServer Pages»