CGS4825 Tutorial 3
Due Tuesday, 10/7 at 12 noon
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.
Implement the Reorganised Controller in the book web application.
It must work exactly like the example from the book.
-
Place the Controller.java, ControllerHelper.java and HelperBase.java files
in the ch3.reorganised package in the Source Packages folder in NetBeans.
-
Place the RequestDataDefault.java file in the ch3.defaultValidate package
in the Source Packages folder in NetBeans.
-
Place the .jsp files in the ch3/reorganised subfolder in the Web Pages
folder in NetBeans.
-
Use the JSPs from the StartExample controller; but, be sure that each one
references the data from the bean in the helper. Replace all param.xxx with
helper.data.xxx.
-
Place all three JSPs in this directory.
-
When you create the JSPs, name them so that the names match the names
in the ControllerHelper class. Names are case-sensitive.
-
Modify the web.xml file so that it has a servlet definition and a
servlet mapping for the servlet controller.
-
Map the controller to the URL /ch3/reorganised/Controller.
-
Add a hypertext link in index.jsp to the controller.
-
Be sure that the index.jsp uses the strict DOCTYPE.
-
Use a relative link from the current location to the controller. Use the
url-pattern from the web.xml, but omit the leading /.
-
All the previous Tutorials should also have links from this page. All of
them should still work.
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
Upload the WAR file to me:
Submitting
homework on-line via the Web.