CGS4825 Assignment 4
Due Monday, 3/31 at 11:59 pm.
After you have Apache running and have deployed your web app, hand in the
assignment by zippping your cgs4825 directory and upload it via
ocelot as follows:
-
Please use the following command to compress your cgs4825 folder.
Log into ocelot and issue the command
zip -r username cgs4825 -x \*.jar \*.zip \*.war
Replacing username with your user name. This will create a file named
username.zip. It contains the Apache conf files and all your web apps.
-
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.
Apache
Configure and start your Apache server.
-
Configure Apache so that it sends all JSP pages and all files from the book
web application to Tomcat.
-
Configure Apache so that it sends all requests for the manager to Tomcat.
-
Add an index.html page to the document root of Apache. Validate it.
-
Add a hypertext link in the index.html page to the root of the book web
application on Tomcat. You must use a relative link.
-
Add a hypertext link in the index.html page to the manager web application
on Tomcat. You must use a relative link.
Servlet Controller
Add a new servlet to your book web application from the last
homework assignment.
-
Download all the necessary files for the Enhanced Controller from Chapter
4 and get it working in your web app in NetBeans.
-
Download the InitLogj4 servlet and be sure it starts when the web application
starts.
-
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:
-
There should be no hidden fields in any of the JSPs.
-
Move the JSPs to an appropriate subdirectory of WEB-INF (not under classes).
-
Use a name other than "helper" to save the controller helper in the session.
-
Add a WishList page. Add a button to the confirm page for the wish list.
Add a button to the WishList page to the edit page; add a button to the WishList
page to the confirm page.
-
Write a warning message to the logger when the edit method is called.
-
Write an info message to the logger when the copyFromSession method is called.
-
Write a debug message to the logger when the process page is called.
-
Run the application with different levels for the logger. Change the logger
level in the constructor of the controller helper. Run the application with
level set to debug, then warn, then info, then error. Review the log file
after each run. View the log file in a separate editor, as NetBeans will
not re-read the file from the disk.
-
Add a price field to the edit page. Add a corresponding bean property that
is a double.
-
Add a quantity field to the edit page. Add a corresponding bean property
that is an int.
-
Echo the price and quantity fields in the confirm, wish list and process
pages.
-
Add an accessor to the bean that will calculate and return the price times
the quantity. Echo the value of this field in the process page.
-
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