CGS4825 Assignment 5

Due Friday, 4/13 at 11:59 pm.

To hand in the assignment, zip your webapps directory and upload it from ocelot.

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.

If you attempted HW4, but were unable to complete it, see me for help.

Adding JAR Files

For this assignment, you must add JAR files to your web application. You may develop your assignment on ocelot or you may use NetBeans.

If you are developing on ocelot, then you need to copy the JAR files from my directory to your lib directory.

  1. Change to the lib directory of your web application.
  2. Issue the command
    unzip ~downeyt/cs/public_html/cgs4825/hibernate.jars/webapp.jars.zip

If you are developing on NetBeans,

  1. Download the zip file to your computer. Zip of JARs
  2. Unzip it.
  3. Open NetBeans and right-click on the project name in the Projects tab.
  4. Right-click Libraries.
  5. Click the Add Jar/Folder button.
  6. Navigate to the directory where the unzipped JAR files are.
  7. Select all the JAR files you want to include in the web application.
  8. You will also need to add two additional files in NetBeans. Additional JARs. Add these to the library, too. After deploying to ocelot, remove these two JAR files from the lib directory on ocelot. If they are left on ocelot, they will cause a memory leak in Tomcat.

Configuring ocelot

You will need to add some paths to the CLASSPATH in .cshrc. Be sure you have all of the following statements in your .cshrc file. Some of these statements were added in previous assignments.

#
#Define the location of Java
#
setenv JAVA_HOME /depot/J2SE-1.5
#
#Define the location of Tomcat
#
setenv TOM_HOME /home/ocelot/aul-user-web/apache-tomcat-5.5.17
#
#Add directories and jars to the CLASSPATH
#

#HW2
setenv CLASSPATH {$TOM_HOME}/common/lib/servlet-api.jar
setenv CLASSPATH {$CLASSPATH}:{$HOME}/cgs4825/webapps/ROOT/WEB-INF/classes

#HW3
setenv CLASSPATH {$CLASSPATH}:{$HOME}/cgs4825/webapps/book/WEB-INF/classes

#HW4
setenv BOOKLIB {$HOME}/cgs4825/webapps/book/WEB-INF/lib
setenv CLASSPATH {$CLASSPATH}:{$BOOKLIB}/log4j-1.2.11.jar
setenv CLASSPATH {$CLASSPATH}:{$BOOKLIB}/commons-beanutils.jar

#HW5
setenv CLASSPATH {$CLASSPATH}:{$BOOKLIB}/hibernate3.jar
setenv CLASSPATH {$CLASSPATH}:{$BOOKLIB}/hibernate-annotations.jar
setenv CLASSPATH {$CLASSPATH}:{$BOOKLIB}/ejb3-persistence.jar

#PROJECT
setenv CLASSPATH {$CLASSPATH}:{$HOME}/cgs4825/webapps/tdowne99/WEB-INF/classes

Post Controller

Implement the Post Controller application, from Chapter 5, on ocelot. This application uses required validation and post requests. Place it in the book web application.

Web Application

In the welcome page for the book web application, add a link to the controller.