Due: Friday, April 20
Please upload your files to CSNS. The files should include all the source code, documentation (optional), and an HTML file hw2.html, which contains a link to your application deployed on the CS3 server. Note that file uploading will be disabled automatically after 11:59PM of the due date, so please turn in your work on time.
[Class Websites] A class website, e.g. the CS520 class website, typically includes some general information about the class (e.g. course name, instructor's contact information, office hours, and so on), as well as a number of sections such as lecture notes and assignments. Note that please do not confuse sections of a website with class sections, which are courses offered in a particular quarter.
In this assignment, you
are going to implement a web application that allows users to create
and manage class websites. Your implementation must use servlet, JSP,
and the
MVC architecture. The data can be stored in application scope, i.e. you
do not need to use a database for this assignment. Note that
no scripting elements
are allowed in JSP pages, and no JavaScript is allowed either.
1. (20pt) The default page of the application lists the existing class websites. For example:
Class Websites |
||||||||
|
The classes in the listing should be ordered first by quarter in descending order, then by course code and section number in ascending order. Clicking on a class should take the user to the website of that class.
2. (30pt) A user may access a class website at the URL http://<host>/<application>/sites/<quarter>/<course>/<section>, e.g. http://localhost:8080/hw1/sites/spring2012/cs520/section1/. If the website already exists, the application should display its content. For example:
Spring 2012, CS520 Section 1 |
||||||||||||||||
|
If a user tries to access a class website that does not exist, the application should display the following:
The class website does not exist. Do
you want to create it? Yes
No
Clicking on Yes should take the user to a page where the class website can be created (as described in the next exercise), and clicking on No should take the user to the application default page where the existing class websites are listed.
2. (20pt) To create a class website, a user must provide the following information about the class:
Spring 2012, CS520 Section 1 | ||||||
|
||||||
Clicking the Create button should take the user to the created class website.
3. (20pt) A user may add more sections to a class website by clicking on Add More Sections. For example:
Spring 2012, CS520 Section 1 | ||
|
||
After a section is added, the user should be redirected back to the class website.
4. (30pt) A user may add items to each section. An item consists of a name and a hyperlink. Fo example:
Spring 2012, CS520 Section 1, Assignments | ||||
|
||||
After an item is added, the user should be redirected back to the class website.