CS320, Fall 2005

Please upload your files using the online turnin server. The files should include all the source code, documentation, and an HTML file midterm.html which contains a link to your JSP page on the CS server. Note that file uploading will be disabled automatically after 1:20PM, and late turnin will not be accepted.

[Problem Description]

In this exam you are going to implement a web application that reads movie box office data from a text file, and displays the data in a table that supports paging. A sample box office data file can be downloaded from here (the same file is also available on the CS server under the /tmp directory so you don't have to copy it there).  Note that the box office information about a movie consists of seven fields: this week's box office ranking, last week's box office ranking, title, weekend gross, cumulative gross, the number of weeks that the movie has been released, and the number theaters in which the movie was shown. Fields are separated by comma in the file.

Your application should consist of a JSP page BoxOffice.jsp and a Java bean BoxOffice.java. You may use more JSP pages or Java classes if necessary, but note that no scripting elements or JavaScript is allowed in the JSP page(s).


When BoxOffice.jsp is requested without any parameters, it displays the first 5 movies in a table as shown below:

Pages: [Previous] 1, 2, 3, 4, 5, 6, 7, 8 [Next]
This Wk Last Wk Title Weekend Gross Cumulative Gross Rlse Wks # of Theaters
1 - Saw II 31725652 31725652 1 2949
2 - The Legend of Zorro 16328506 16328506 1 3520
3 - Prime 6220935 6220935 1 1827
4 2 Dreamer: Inspired by a True Story 6132856 17374339 2 2491
5 3 Wallace & Gromit: The Curse of the Were-Rabbit 4302316 49694983 4 2935

When a user clicks Previous, Next, or one of the page numbers, the corresponding movie listings should be displayed, for example, the following table should be displayed when the user clicks page 3:

Pages: [Previous] 1, 2, 3, 4, 5, 6, 7, 8 [Next]
This Wk Last Wk Title Weekend Gross Cumulative Gross Rlse Wks # of Theaters
11 6 Elizabethtown 2382813 22699053 3 2137
12 12 "Good Night And Good Luck." 2003682 7239225 4 272
13 8 In Her Shoes 1717152 29225030 4 1402
14 9 A History of Violence 1351883 28542075 6 1011
15 80 G 1280851 1922579 7 495

Note that
[Grading Criteria]