If you did not do a previous Tutorial, then create a web application named book in NetBeans. Review the web page that contains instructions on creating a servlet in a NetBeans project: Creating a Project in NetBeans
All previous Tutorials should still be able to be accessed and run from the application.
If you had errors in any of the previous tutorials, fix them, so that you do not lose points again for old mistakes.
Implement the Persistent Controller in the book web application. It must work exactly like the example from Chapter 5 of the book.
log4j-1.2.11.jar
(should already be there from Tutorial 4)
commons-collections-2.1.1.jar
(should already be there from
Tutorial 4)
commons-logging-1.0.4.jar
(should already be there from Tutorial
4)
commons-beanutils.jar
(should already be there from Tutorial
4)
shared
package in the Source
Packages folder.
InitLog4j.java
(should already be there from Tutorial 4)
HelperBaseCh4.java
(should already be there from Tutorial 4)
ButtonMethod.java
(should already be there from Tutorial 4)
HelperBaseCh5.java
HibernateHelper.java
PersistentBase.java
WebappListener.java
Controller.java
, and
ControllerHelper.java
in the ch5.persistentData
package in the Source Packages folder in NetBeans.
spr09_
prepended to your ocelot
user name. The name of your database is the same as your mysql user name:
spr09_username
jdbc:mysql://ocelot.aul.fiu.edu:3306/spr09_username
spr09_username
RequestDataPersistent.java
file and
place it in the ch5.persistentData
package.
RequestDataRequired.java
, from the
first part of Chapter 5.
Id
property as is outlined in the book,
PersistentBase
.
ch5.persistentData
package in the
Source Packages folder in NetBeans.
ch5.postController
controller, but copy
them into the ch5.persistentData
package.
form
method to POST. If you don't do this,
then you will always be stuck on the edit page.
Edit.jsp
file so that it will display any errors
generated by the validation of the Hobby
and
Aversion
.
id
, hobby
and aversion
for each row in the table. Place the data from each row on a separate line.
for
loop to iterate through the rows in the table.
You will need to add the taglib statement that includes the JSTL in the JSP.
/ch5/persistentData/Controller
.
create
initialization parameter to the servlet definition.
true
, to create the table the first time you
run the servlet.
false
, so that your
data will not be lost the next time Tomcat restarts.
listener
tag so that the WebappListener
will close resources when Tomcat shuts down.
When you are done with everything, your directory and file structure should
look like this.
Take a look at your log file, you will see that there are messages in it.
build -> web
-> WEB-INF -> logs
error.log
file. It will look something like this.
Before you submit your homework, be sure that you have set the
create
parameter in the web.xml file to
false
.
Be sure that your NetBeans project is configured so that .java files are added to the WAR file: Adding .java files to a WAR file
Clean and Build your web application. After doing this, navigate to the WAR file in NetBeans and verify that the .java files are included: View WAR File
In the operating system (not in NetBeans) navigate to the dist folder in the NetBeans project.
Deploy the WAR file on ocelot: Deploy a WAR File
WEB-INF/logs
directory in winscp or
on ocelot.
error.log
file to 606. This will
allow Tomcat to write to the file.
The WAR file is too big for you to submit to me. To hand in the tutorial, zip the book web app directory and upload it. If your book web app is named something other than book, then use that name in the zip command.
zip -r username ~/cgs4825/webapps/book -x \*.jar \*.zip
\*.war
~downeyt/cs/public/webftp/webftp.pl