CGS4825, Assignment 3
Due Wednesday, 8/9 at 5:00 pm
Zip and upload your cgs4825 directory. Exclude all .jar, .zip and
.war files.
-
Please use the following command to compress your cgs4825 folder.
Change to your root directory on ocelot and issue the command
zip -r username cgs4825 -x \*.jar \*.zip \*.war \*error_\*
\*access_\* \*.gif \*.jpg
Replacing username with your user name.
-
If you have any other archived files in your directory, like .rar, or .ZIP,
or .WAR, please remove them before zipping.
-
Check the size of the ZIP file, it should be less than 1 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 file as binary.
Modify .cshrc
Edit the .cshrc file.
Apache
Shut down your Apache host. It is not needed for this assignment and it will
slow down ocelot.
Tomcat
For the username web application.
-
Set cgs4825.jsp as the default page for all directories.
Web Application
Create an application that does required validation. The application should
be in a package named hw4.
-
The application should use the new techniques from Chapters 3 and 4.
-
A bean to encapsulate the data. Extend the bean from BeanBase.
-
Use the session instead of hidden fields.
-
Automatically populate the bean with data from the query string.
-
Save the request and response objects in the bean.
-
Use required validation to validate at least one of the data fields.
-
The validation will only be performed during a POST request.
-
Whenever a GET request is made, do not initialize the bean from the session
and always display the Edit page.
-
There will be three JSPs in this application: Edit, Confirm and Process.
-
Place the JSPs in the same directory as the Controller.
-
The Edit page should have three text boxes and a submit button. Initialize
the text boxes with the corresponding values from the bean.
-
The Confirm page should display the data from the Edit page as plain text.
It can also send the data to the Edit page or Process page.
-
The Process page should display the data from the Confirm page as plain text.
There should be two buttons: Edit and New.
-
When Edit is clicked, go to the Edit page. Initialize the bean with data
from the session.
-
When New is clicked, go to the Edit page. Do not initialize the bean with
data from the session.
-
Choose a common theme for these text boxes.
-
One of the fields should be a field that can be used for identification,
like email, phone, SSN, VIN, ISBN, PID, etc.
-
Indicate on the Edit page what format the user is expected to enter for this
field.
-
Validate that this field has the correct format using a hibernate Pattern
annotation. You must validate that it has a specific format. Do more than
test for non-null and not emtpy. Credit will not be given if the validation
is too simple.
-
If the data is invalid, remain on the Edit page and display an appropriate
message.
-
Only validate when the user clicks the Confirm button during a POST request.
-
In most of the JSP forms, a button click should send a POST request. There
will be one button that should make a GET request.
Style Sheet
Create a directory in the root of the username web applciation named
css.
-
Create a style sheet in this directory.
-
Change the following default properties for the page.
-
Change the default font and font size. You must select at least one specific
font, and there must be a final choice which is a generic font family.
-
Change the default background color.
-
Change the default foreground color.
-
Change the default right and left margins.
-
For input elements that have a type of text.
-
Change the foreground color
-
Change the background color
-
Change the font to a monospace font. You must select at least one specific
font, and there must be a final choice which is a generic monospace font.
-
For select elements.
-
Change the foreground color
-
Change the background color
-
Define the numbering for nested ordered lists.
-
If there is an ordered list within an ordered list, then it should use a
different ordering.
-
If there is an ordered list within an ordered list within an ordered list,
it should use a third ordering.
-
Use
www.w3.org
to validate your style sheet.
-
Use the style sheet for the following pages.
-
cgs4825.html in the document root of Apache.
-
cgs4825.jsp in the root of Tomcat.
-
cgs4825.jsp in the root of the username web application.
-
All the JSPs for this assignment.
Web Application - Continued
Update some classes.
-
Add the DataCollections class to the utilities package.
-
Update the BeanBase class with the new one from Chapter 5 that includes the
DataCollections.
Add a multiple select list to your Edit page.
-
Initialize the select list with data from the bean.
-
On the Confirm and Process pages, display the user's data in a table.
-
Have a row in the table that contains a heading that spans all the columns.
-
Have a row in the table of column headings for the form elements.
-
Have a row that displays all the user's data, with each property in its own
TD element.
-
For the multiple valued property, display all of its values as an ordered
list inside its TD element.
-
Using the style sheet:
-
Change the background color of the TD elements.
-
Change the foreground color of the TD elements.
-
Change the background color of the TD element that has the ordered list to
a different color than for default TD elements.
-
Change the foreground color of the TD element that has the ordered list to
a different color than for default TD elements.
Save the bean to a database.When the user clicks the process button, write
the user's data to your mysql database using Hibernate.
-
You must set the connection URL to use mysql on ocelot
jdbc:mysql://ocelot.aul.fiu.edu:3306/spr06_username
-
The username for mysql on ocelot is
sum06b_username
-
The initial password is you panther id. Please log into mysql and change
your password. Follow the steps from the class page:
mySql commands.
-
Be sure to add a create parameter to the servlet definition in the
web.xml file. Set this to true the first time you run the servlet,
then change it to false. Any time you want to recreate the database
tables, set it to true and restart the web application. After the
tables have been recreated, set it back to false.
-
There are many different errors that can happen when saving to the database.
There will be information about these errors in the webapps/log folder.
Refer to this link to help understand what the messages mean:
Various
Errors.
Display all the current data from the database in the process page.
-
Important: Send all the data to the JSP as a collection of beans.
This should be sent to the JSP by setting an attribute in the request. Do
not use the session.
request.setAttribute("database",
command-to-get-collection-of-beans);
-
Loop through the data using the JSTL and present it in nested ordered
lists.
-
The top level list will contain the unique field.
-
For each of these fields, create a nested ordered list that has all the other
data for this user.
-
When displaying the data from the multiple select list, display it in a third
nested list. The numbering for all these lists should be different, if your
style sheet is working properly.