218 The XML Files: Develo pment of XML/XSL Applications Using WebS phere Studio
Figure 10-2 Customer registration scenario outline
Retrieving cu stomer information
When retrieving customer data, the user enters the membership number of the
customer whose information is to be retrieved in the form provided by the HTML
in the client layer. When the user clicks the Submit button, a series of interactions
between system components take place, as indicated in Figure10-3 on
page 219, and in the following steps:
1. The HTML sends that value to the servlet through the HTTP request to the
servlet, invoking the servlet doGet method.
2. The servlet validates that the us er has entered a membership value. Then the
servlet invokes the findByPrimaryKey method that belongs to th e
CustomerFactory class, using the input membership value.
3. The CustomerFactory retrieves the data from the database, and constructs a
customer entity bean setting its attributes with the values returned from the
database.
4. The servlet provides the returned entity bean to the CustomerXML, which
converts that bean into a DOM representation.
HTML
DB
DB
HTML 12
Customer
(Entity Bean)
Customer
Factory
XML Data
XSLT
Processor
Customer XSL
Customer
Result XSL
Web
Browser
9
10
Customer XHL
(DOM)
7
3 6
4
5
9
XSL Servlet