Homework
1
CS320,
Fall 2006
Due: Tuesday, October 17
Please upload your files using CSNS.
The files should include all the source code, documentation, and an
HTML
file hw1.html,
which
contains a link to your servlet 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.
[Reading]
- Textbook Chapter 1, 3, 4, 5,
19
except 4.7.
[Online Album]
For this assignment, you are going to write a
servlet that implements
an online
album manager, which manages
pictures for a number of users. Each user has
their own home page, which we call an album,
where they can add and delete pictures, edit the information about the
pictures.
and organize the pictures in some folders.
In particular,
- (10pt) When the
servlet is requested
without any parameter, it displays a list of the albums currently
managed by the application. For example:
Welcome
to CS320 Online
Albums |
|
For
this assignment,
you need to have at least two users (with cysun
being one of them). When a user clicks on one of the albums, the
application should displays the selected album as described below.
- (30pt) When the servlet is
requested with a user
parameter, e.g. http://cs3.calstatela.edu:8080/cs320stu31/servlet/AlbumManager?user=cysun,
it displays the album of the specified user, which may look like the
following:
If the
servlet is requested with an invalid user, simply displays the front
page with the list of the albums.
- (20pt) An album may have a number of folders. Each folder has a
description and contains a number of pictures. For this assignment, you
must create at least two folders in each album. A user may choose to
see
the pictures in a folder by clicking on the name of the folder. Note
that currently selected folder should not be "clickable".
- (10pt) When a user clicks Delete,
the corresponding picture will be deleted. We will leave
editing for next time.
- (30pt) When a user clicks
the Add
New Picture button, the
servlet displays the following page
which allows the user to add a new picture:
[NOTES]
- The easiest way to start
this
application (or any other web
application for that matter), is to separate the business logic
and the presentation
part of the
application, and start with the business logic. In particular, the
business
logic of this application may consist of the following classes: Album,
Folder, and Picture.
Once you have completed these classes, the presentation part, which is
the servlet, is quite
straight-forward - simply create a few Album
objects (together with their owners, folders, and pictures) as class
variables of the servlet,
and display or update the objects based on the HTTP requests.
- Since we have not covered
databases yet, the content of the albums may be lost after
the servlet is unloaded or reloaded.
That's ok for this assignment.
- Our subsequent homework
assignments will be built on top of this
assignment, so make sure your design, especially
the business logic part, is extensible.
- Do not
spend too much time on the user interface - we will do that in later
assignments when we use JSP.