CGS4825 Assignment 3
Due Monday, 3/10 at 11:59 pm.
To hand in the assignment, zip your webapps directory and upload
it via the web:
Submitting
homework on-line via the Web.
-
Please use the following command to compress your webapps folder.
Log into ocelot and issue the command
zip -r username cgs4825/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 book 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.
-
Use my uploading program from ocelot to upload the file.
~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.
After uploading, do not modify your files on ocelot until after your assignment
has been graded.
Servlet Controller
Add a new servlet to your book web application from the last homework
assignment.
-
Download all the necessary files for the Reorganised Controller from Chapter
3 and get it working in your web app in NetBeans. Create the correct
subdirectories in the Web Pages folder, for the JSP files.
-
Use the RequestDataDefault bean as the bean in the application.
-
Get the controller working as it is on the web site. Do not change its package.
You will need to create the corresponding package in the Source Packages
folder of the project.
-
Modify the application as follows:
-
Add a new field to the edit page: the field will be for someone's full name.
In the JSP, initialise the name with the corresponding value from the bean.
-
Add a correpsonding property to the bean. In the bean, format the name so
that the first letter of each word is capitalised and all the other letters
in each word are lower case. Hint: use a loop and a StringBuffer that is
initialised to the name.
-
Echo the modified value from the bean in the confirm and process pages.
-
Create a servlet definition and mapping, for the controller, in the web.xml
file: Servlet Mapping. Do not remove the
servlet definition and mapping for the servlet from the last assignment.
Be sure that the servlet name for the new controller is unique.
-
In the index.jsp file for the web application, add a hypertext link to the
mapping for the controller. Use a relative link. Do not remove the link that
you created for the last assignment.
-
As in the last assignment, 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, then create the index.jsp file in the ROOT directory,
as was explained in the previous assignment.