Programming for the WWW G22.3033-009
Homework Assignment #4
1) You must change the mechanism used by the Customer class to use Java serialization to write an object out to disk and to read it back in from disk (instead of the file writing code you created yourself to save a customer to disk).. It should use the same naming convention but have the ".ser" extension instead of the ".txt" we used before.
2) Modify the servlet that you created in HW#3 to use this serialization/deserialization mechanism to read/write customer objects.
3.) Create a JSP that is the customer information browser (GVBooksCustomerBrowser screen shot below). It should have a list of all the customer files that are stored on your application.
4) Create a JSP that is a home page (like GVBooksMain screen shot below) with SUBMIT BUTTONS in a form that have links to execute each of the JSPs/Servlets in this homework. That means you need BUTTONS for:
This JSP should use POSTs to tell this JSP what JSP/Servlet to execute next. You should use the RequestDispatcher class in your JSP to accomplish the jumping to the selected JSP/Servlet.
The grading criteria for this homework:
1) Create 4 JSPs or 3 JSPs and 1 servlet (the CustomerInfo from HW#3)
2) The main page should use a POST and SUBMIT button that uses if statements to use a RequestDispatcher and the forward()method to invoke the corect JSP from the code in the main JSP.
4) The main page should invoke 1 of three other JSPs - CustomerInfo, CustomerBrowser and OrderBrowser.
5) CustomerInfo should be a working JSP (or Servlet if you wish) that saves and loads a customer object from disk. You can hard code the file name that the object gets saved/loaded from
6) The CustomerBrowser and OrderBrowser JSPs can be dummy JSPs with only the list and buttons but no code to actually load the stuff from disk or display anything.
7) The Customer class must use serialization to save out individual customer objects and load them back in.
8) You MUST use localhost:8080 in all your URLs in your code!! Not your specific machine name or IP address or anything else.
Hints and Help
Here is the HTML to use for the Order Browser JSP
Here is for the Customer Manager JSP