Download "user manual"

Transcript
// get the price from the database, update the data base with the ticket and
// place a message on the queue and prepare the orderconfirmed.jsp for display
//
} else if (action.equals("SubmitOrder")) {
String origin = request.getParameter("Origin");
String destination = request.getParameter("Destination");
String singles = request.getParameter("Singles");
String returns = request.getParameter("Returns");
String customerName = request.getParameter("CardHolder");
String cardNumber = request.getParameter("CardNumber");
String expireMonth = request.getParameter("ExpireMonth");
String expireYear = request.getParameter("ExpireYear");
int price = service.getJourneyPrice(origin,destination);
int totalCost = (Integer.parseInt(singles) * price) +
(Integer.parseInt(returns) * 2 * price);
request.setAttribute("TotalPrice", Integer.toString(price));
service.submitOrder(origin, destination, singles, returns,
customerName, cardNumber, expireMonth, expireYear,
Integer.toString(totalCost));
nextpage = "/orderconfirmed.jsp";
// not used currently
}else if (action.equals("NewOrder")){
nextpage = "/neworder.jsp";
}
RequestDispatcher rd = sc.getRequestDispatcher(nextpage);
rd.forward(request, response);
} // end method
13.4.4 Creating a user interface
The Ticketing application uses various JSPs to display data to the user. Within
the ITSO Railways Ticketing Web Application project and within the
WebContent/Theme create the JSP by selecting File → New → Other to invoke
the New Wizard. Within the New Wizard select Web in the left column and JSP
in the right column, then click Next. Enter the JSP name selectorigin and click
Finish. The selectorigin.jsp was developed using Page Designer. Figure 13-10
on page 302 shows a preview of the JSP, so you can see its structure.
Chapter 13. Using Workplace Client Technology, Micro Edition
301