CS6320:  SW Engineering of Web Based Systems

 

   Exercise 6:  Servlet that Reads HTTP Request Headers
due April 24
  • Create a Servlet that extends HttpServlet.
  • It should inside of its doGet method, create or retrieve the session associated with the client request.
  • Create a web-page that has the following HTML form in it.
    • When the button submit is hit, it will invoke via GET method your servlet. (it should store product name in session)
    • When the button invalidate session is hit, it will invoke via GET method your servlet. (it should invalidate session)
    • When the button view previous choice is hit, it will invoke via GET method your servlet. (it should then return the current product value stored in session ---if nothing there or no session should report it.)
  • Servlet reacts as follows via reading parameters sent in the client's request
    • if submit button was hit, it will read in the value associated with the textbox and store this as a new product ordered. (replacing old value of product if currently one exists in the session)
    • if invalidate session button was hit, it will invalidate the session associated with the request.

    Enter your new product choice for your session

    OR hit View to see past choice if exists

    New Product name: 

     

© Lynne Grewe