Lab 1. Beans, EL, and JSTL
CS320, Spring 2011


Due: Wednesday, April 20, 4PM

Please upload your files for Part II to CSNS. The files should include all the source code, documentation (optional), and an HTML file lab1.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.

[Part I] (10pt) Please complete Part I on CSNS. Wait until the instructor grades it before you proceed to Part II.

[Part II] (20pt) For this exercise you are going to implement an online test application using JSP. The application reads a number of multiple-choice questions from a text file, displays the questions one at a time, and collects the answers from a user. Once the user completes all the questions, the application compares the user's solution to the standard solution and displays a score.

A sample file for a test can be downloaded here. The format of the file is as follows:

Implement a TestEntry class which consists of at least the following methods:

Implement a class TestBean which consists of at least the following:

Create a JSP page Test.jsp that uses a session scope TestBean. Test.jsp displays the test entries one at a time, and displays the score when the user completes the test, as shown in the sample display below. Note that you may not use scripting elements in the JSP.

When the page is requested for the first time:
When the page is displaying the last entry:
After the user clicks FINISH:
You may drive off of the paved roadway to pass another vehicle:
1. If the shoulder is wide enough to accommodate your vehicle
2. If the vehicle ahead of you is turning left.
3. Under no circumstances
To avoid last minute moves, you should be looking down the road to where your vehicle will be in about ______________.
1. 5 to 10 seconds
2. 10 to 15 seconds
3. 15 to 20 seconds

Your score is: 80

Hints:

[Post-Lab Activities]