Professional Documents
Culture Documents
Lab 5
Lab 5
LAB 5: SERVLET -2
Lab Activities
1. Developing the AddDVD form
b) Add a form to add_dvd.html that performs a POST request to the URL add_dvd.do
c) Create the form elements to gather the data.
MMR@FSKM2018
CSC 584 ENTERPRISE PROGRAMMING
MMR@FSKM2018
CSC 584 ENTERPRISE PROGRAMMING
b) Within the processRequest method, retrieve the DVDItem instance from the request object using
the attribute name dvdItem.
c) Use print statements to generate the HTML response, displaying the information in the DVDItem.
d) Include a hypertext link back to the home page in the HTML
MMR@FSKM2018
CSC 584 ENTERPRISE PROGRAMMING
MMR@FSKM2018
CSC 584 ENTERPRISE PROGRAMMING
e) Modify the section of code in which the dispatch is performed and check the errors list
i. If the errors list is empty, store the DVDItem in the request object and dispatch to the
URL /success.view.
ii. If the errors list is not empty, store the errors list in a request attribute called errorMsgs
and dispatch to the URL /error.view
MMR@FSKM2018
CSC 584 ENTERPRISE PROGRAMMING
MMR@FSKM2018