HTML

1

 

9

XSL Servlet

7

XML Data

2

Customer XHL

(DOM)

3

6

Customer

Factory

Web

Browser

XSLT

Processor

10

HTML

9

Customer XSL

Customer Result XSL

4

Customer (Entity Bean)

5

DB

Figure 10-2 Customer registration scenario outline

Retrieving customer 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 Figure 10-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 user has entered a membership value. Then the servlet invokes the findByPrimaryKey method that belongs to the 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.

218 The XML Files: Development of XML/XSL Applications Using WebSphere Studio

Page 234
Image 234
IBM Version 5 manual Retrieving customer information, Customer registration scenario outline