CGS4854 Assignment 2
Due Thursday, 2/10
Servlet Controller
Modify the username web application that you created for Assignment 1. Do
not create a new web application, reuse the one for homework 1. Do not remove
homework 1, do not modify homework 1. You should be able to run either homework
1 or 2 from the web application.
- Do not modify the JSP with the form that was created for Assignment 1.
You may copy it to the location of the files for this assignment and then
modify it, but please leave an unchanged copy of it in the location of the
homework 1 files.
- Implement a servlet controller for your application. The controller
should behave like the servlet controller from Chapter 2 of the book.
- Instead of using my field of hobby, use your two fields from
Assignment 1.
- Add appropriate paragraphs for your application: to the edit, confirm
and process pages. These paragraphs should contain descriptions of each
page. If you do not have good paragraphs, you will lost points on the
assignment. Pretend that this is a real web site that users are
accessing. These users do not know anything about your site. There
should be information on each page that explains what service you are
providing and what the user is supposed to do on the current page. A
paragraph contains more than one sentence.
- In addition to the Edit, Confirm and Process pages,
create another JSP that will also display the data that is sent to it.
- Name the page WishList.jsp.
- The wish list page will display the data from the fields that are
sent to it, but will not let the user edit them. Eventually, this is a
page where users will be able to store information, without purchasing
it. Please add an appropriate description to this page for your web
application. If you do not have a good description, then you will lose
points.
- Add buttons to the wish list page that can send the user's data back
to the edit page or to the confirm page. Do not add a button for the
process page.
- Add a button to the confirm page that can send the user's data to the
wish list page. This is a new button, in addition to the edit and
process buttons. Do not add a button to either the Edit page or the
Process page for the WishList page.
- Add a hypertext link in the index.jsp page of the username web app to the
visible URL of your controller. Use a relative link. Do not remove the link
to the homework 1 file.
- The web app must use the secure web.xml file and should only allow
you and me to access your application: Edit tomcat users
- Be sure to modify the project so that the .java files are
placed in the WAR file: Configuring WAR
File
- After the app is running in NetBeans, upload it and run it on ocelot: Uploading a WAR file
ROOT Web Application
If you did not do so in Assignment 1, then in the index.jsp of the ROOT web
app, add a hypertext to the manager application. Use a relative reference to
manager/html.
If you did not do so in Assignment 1, then in the index.jsp of the ROOT web
app, add a hypertext to the root of the username web application. Use a
relative reference to the web app root.
If you did not do so in Assignment 1, then add a paragraph of at least 4
sentences to the index.jsp in the ROOT web app.
Hand In Assignment
To hand in the assignment, zip your webapps directory and upload
it via ocelot.
- Remove the old username.zip file, if it exists.
- If you are using WinSCP, then delete the file.
- If you are on ocelot, then issue the command
rm username.zip
Replacing username with your user name.
- Please use the following command to compress your webapps folder.
Log into ocelot and issue the command
zip -r username ~/cgs4854/webapps -x \*.jar \*.zip \*.war
Replacing username with your user name. This will create a file
named username.zip. It contains the ROOT, manager and username web
applications.
- Check the size of the ZIP file, it should be less than 3 MB. If it is
not, then you probably have another ZIP file stored in the ZIP archive.
Delete it and re-zip.
- You may upload the zip file by downloading it to your computer and submitting
it through my upload program,
or you may use my uploading program from ocelot to upload the file. You must connect
to ocelot using Putty to run this command, it cannot be run from winscp.
Enter this
command at the command prompt:
~downeyt/cs/public/webftp/webftp.pl
- Upload the username.zip file as binary.
Be sure that all your files and subdirectories are included in the zip
file.
Be sure that the .java files have been deployed to ocelot.
Including Source Files
After uploading, do not modify your files on ocelot until after your assignment
has been graded.