Order the Book

coreservlets
Class Travel

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--coreservlets.Travel

public class Travel
extends HttpServlet

Top-level travel-processing servlet. This servlet sets up the customer data as a bean, then forwards the request to the airline booking page, the rental car reservation page, the hotel page, the existing account modification page, or the new account page.

Taken from Core Servlets and JavaServer Pages from Prentice Hall and Sun Microsystems Press, http://www.coreservlets.com/. © 2000 Marty Hall; may be freely used or adapted.

See Also:
Serialized Form

Constructor Summary
Travel()
           
 
Method Summary
 void doPost(HttpServletRequest request, HttpServletResponse response)
          Since password is being sent, use POST only.
 void init()
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Travel

public Travel()
Method Detail

init

public void init()
Overrides:
init in class GenericServlet

doPost

public void doPost(HttpServletRequest request,
                   HttpServletResponse response)
            throws ServletException,
                   IOException
Since password is being sent, use POST only. However, the use of POST means that you cannot forward the request to a static HTML page, since the forwarded request uses the same request method as the original one, and static pages cannot handle POST. Solution: have the "static" page be a JSP file that contains HTML only. That's what accounts.jsp is. The other JSP files really need to be dynamically generated, since they make use of the customer data.
Overrides:
doPost in class HttpServlet

Order the Book

Order
CSAJSP @ amazon.com

Return to Top-Level Source Code Archive