Prentice Hall and Sun Microsystems. Personal use only; do not redistribute.
366
Chapter 15 Integrating Servlets and JSP
Listing 15.5 TravelCustomer.java
package coreservlets;
import java.util.*;
import java.text.*;
/** Describes a travel services customer. Implemented
* as a bean with some methods that return data in HTML
* format, suitable for access from JSP.
*/
public class TravelCustomer {
private String emailAddress, password, firstName, lastName;
private String creditCardName, creditCardNumber;
private String phoneNumber, homeAddress;
private String startDate, endDate;
private String origin, destination;
private FrequentFlyerInfo[] frequentFlyerData;
private RentalCarInfo[] rentalCarData;
private HotelInfo[] hotelData;
public TravelCustomer(String emailAddress,
String password,
String firstName,
String lastName,
String creditCardName,
String creditCardNumber,
String phoneNumber,
String homeAddress,
FrequentFlyerInfo[] frequentFlyerData,
RentalCarInfo[] rentalCarData,
HotelInfo[] hotelData) {
setEmailAddress(emailAddress);
setPassword(password);
setFirstName(firstName);
setLastName(lastName);
setCreditCardName(creditCardName);
setCreditCardNumber(creditCardNumber);
setPhoneNumber(phoneNumber);
setHomeAddress(homeAddress);
setStartDate(startDate);
setEndDate(endDate);
setFrequentFlyerData(frequentFlyerData);
setRentalCarData(rentalCarData);
setHotelData(hotelData);
}
Second edition of this book: www.coreservlets.com; Sequel: www.moreservlets.com.
Servlet and JSP training courses by book's author: courses.coreservlets.com.
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved