Lab 2. MVC
CS320, Winter 2012
Due: Monday, February 13, 10:00PM
Please upload your files to CSNS.
The files should include all the source code, documentation (optional),
and an
HTML
file lab2.html
which
contains a link to your application deployed on the CS3
server. Note that
file
uploading will be disabled at 4PM, and no submission will be
accepted after that.
(30pt) Complete the Fall 2008 Midterm. Your application must use the MVC architecture.
HINTS:
1. Create a Car class to hold the information about a car.
2. The application can be implemented with just one servlet:
- In the init() method, read the data file, initialize a List<Car> and store it in the application scope.
- In the doGet() method, forward the request to a JSP to display the search form.
- In the doPost() method, perform the search, store the results in a List<Car>, and pass it as a request scope variable to a JSP to display.
3. If you find yourself repeating the same (or similar) code again and again, create a method.