CGS4825 Project
Due Friday, 4/18 at 6:00 am.
The due date has been pushed back by 6 hours. The new due date is Friday,
4/18 at 6 am.
To hand in the assignment, zip your cgs4825 folder and upload
it from ocelot.
-
Please use the following command to compress your cgs4825 folder.
Change to your ~ directory on ocelot and issue the command
zip -r username cgs4825 -x \*.jar \*.zip \*.war \*.log
Replacing username with your user name.
-
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 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.
Overview
You are to create a service oriented web site. Users will be able to log
into your site and maintain an account on your site. The type of service
that you provide is your choice. For example, the site that was developed
in the book kept track of a user's hobby and aversion. Try to be creative
in picking your site. There are already enough book sellers on the web and
one site that keeps track of hobbies is enough. Choose a service that interests
you.
The assignment is long, if you wait until the last week to start, then you
will not have enough time to finish it. Even though some of the features
have not been covered in class, there are many things that can be implemented
now. Please get started.
Step One
On Apache
-
Configure Apache so that the URL /username is handled by Tomcat. Replace
username with your user name.
-
Configure Apache so that all URLs that start with /username/ are handled
by Tomcat. Replace username with your user name.
-
Configure Apache so that all URLs that end with .jsp are handled by Tomcat.
-
Configure Apache so that all URLs that start with /manager/ are handled by
Tomcat.
-
Configure Apache so that index.html and cgs4825.html are both set as welocme
pages.
-
Create a directory named project.
-
For this directory and its subdirectories, make cgs4825.html the first
choice for a default page when a directory is requested. All other directories
should display index.html as the first choice.
-
Limit access to this directory to you and me. Access to the root directory should not
be restricted.
-
Use Basic authentication.
-
The password file is located in /aul/homes/downeyt/cs/etc/0801/registered.passwd
-
Create a subdirectory of project named errors.
-
Create a page for 404 errors.
Using SSI tags, include the banner and footer files, from the includes directory, in this file.
-
Create a page for 403 errors.
Using SSI tags, include the banner and footer files, from the includes directory, in this file.
-
Create a page for 500 errors.
Using SSI tags, include the banner and footer files, from the includes directory, in this file.
-
For the project directory and its subdirectories, make these the error pages
that Apache will show when there is an error. All other directories should
still show the Apache default error messages.
-
Create a cgs4825.html page in the project directory.
-
Create at least three meaningful paragraphs that describe your site and the
service that you will provide.
-
Create a link to a file that does not exist.
-
Create a link to a file that does not have any access.
-
Create a link to the root of the your-username web application on Tomcat.
Use a relative reference from the Apache server, do not include an absolute
reference to the Tomcat server on port 8008.
-
Create a link to the manager web application on Tomcat. Use a relative reference
from the Apache server, do not include an absolute reference to the Tomcat
server on port 8008.
-
Edit the index.html file in the root of Apache.
-
Create a short description of your website and the services that it provides.
-
Create a link to the project directory.
-
Create a link to a file that does not exist.
-
Create a link to a file that does not have any access.
On Tomcat,
-
Create a new web application named your-username.
-
Use the secure web.xml file.
-
Create a welcome page named index.jsp. Be sure that this is the page
that is displayed when the root of the web application is requested.
-
Restrict access to this web site to you and me.
-
Create a servlet controller application that is similar to the
ch4.enhanced
application.
-
Do not use hidden fields.
-
Use a controller helper and helper base.
-
Use a data bean to store the data from the request.
-
Automatically populate the data from the request into the bean.
-
Use a logger to write informational messages.
-
Use the ButtonMethod attributes to annotate the controller helper and simplify
the
doGet
method.
-
Place the JSPs in the same directory as the controller.
-
Instead of using the two fields hobby and aversion, create
three different text fields to gather information form a user for your site.
The fields should be relevant to the service that your site is providing.
Be creative.
Step Two
On Tomcat,
-
Modify the application so that it handles GET and POST requests.
-
Modify your JSPs so that they use POST.
-
A GET request should not retrieve data from the session and should always
display the edit page.
-
A POST request should retrieve data from the session and should display different
pages, based upon the button that was clicked.
-
Add an additional property to your application. This property must be numeric:
int, float or double. It must be related to the service that your site is
providing.
-
Add required validation to your application.
-
Validate that the numeric field is in a specific range of numbers. Do not
include 0 in the range. There are additional annotations that can be used
with numeric properties.
Built-in
Annotations for Hibernate.
-
@Min(value=100)
-
@Max(value=200)
-
@Range(min=100,max=200)
-
Each of these needs an import statement:
import org.hibernate.validator.Min;
import org.hibernate.validator.Max;
import org.hibernate.validator.Range;
-
Validate that one of the string properties only contains uppercase letters,
lowercase letters and spaces.
-
For each field that is to be validated, display information in the web page
that indicates the correct format of the data to be entered.
-
When the process button is clicked, save the user's information in a database.
Do not display all the data from the database in the process page,
only display the data that the user entered.
-
Modify the edit button on the process page so that it starts a new transaction.
-
The edit page should be shown after the button is clicked.
-
The old data should not appear in the edit page.
-
Add a new button to the process page.
-
When the button is clicked, show a new page that will display all the data
that is stored in the database.
-
Use a tag from the JSTL to loop through all the records in the database and
display all the data for each record.
-
Add a button to the new page that will start a new transaction.
-
The edit page should be shown after the button is clicked.
-
The old data should not appear in the edit page.
Step Three
On Apache,
-
Create a subdirectory of project named styles.
-
Create a stylesheet in the styles directory.
-
Change the backgournd color of the page. If you are having a difficult time
deciding on colors, try this site
http://www.siteprocentral.com/html_color_code.html
-
Change the text color of the page.
-
Change the font of the page. Use the font-family attribute and specify a
very specific font, a more common font and a generic font.
-
Change the left and right margin of the page.
-
Define the color for hypertext links. Use the A:LINK pseudo tag.
-
Define the color for visited links. Use the A:VISITED pseudo tag.
-
For H1 and H2 headings,
-
H1 and H2 headings should use a different font than the body. Use the font-family
attribute and specify a very specific font, a more common font and a generic
font.
-
H1 and H2 headings should have center alignment.
-
Make all H1 headings use upper case letters.
-
Make all H2 headings use capitalized first letters for each word in the heading.
-
Define the var tag to be underlined. Be sure that any text that uses
this tag does not appear italicized. The default style for this tag is
italicized, be sure to turn this off. Change the font for this tag to be
a monospace font. Use the font-family attribute and specify a very specific
font, a more common font and a generic font.
-
Define the em tag to be bold and 10% larger than the font used
in the body. Make the text color different from the text color in the body.
Be sure that any text that uses this tag does not appear italicized.
-
Define nested ordered lists, use two different numbering systems for two
levels of nested ordered lists. Do not use decimal for either numbering.
-
Use the stylesheet in all your HTML pages on Apache.
-
In the cgs4825.html in the project directory.
-
Add an H1 heading to the page. Place it at the top, after the included header.
-
Add an H2 heading above each of the three paragraphs on your page.
-
Use the var tag several times in the page.
-
Use the em tag several times in the page.
-
Create a nested ordered list with two levels of nesting. The list will contain
links to parts of the assigment.
-
Directories
-
link to errors directory
-
link to the Apache root directory
-
Files
-
link to nonexistent file
-
link to resticted access file
-
Project
-
link to project root
-
link to project controller
Extra Credit [optional]: On Tomcat,
-
Add a checkbox group to your project application.
-
Add a single selection list to your project. Include at least six options.
Validate that the value that is selected is one of the values from the selection
list. It is possible that someone could write their own form to access your
site, so it is always good to validate, even when using a selection list.
-
Initialize the checkbox group and the selection list according to the values
in the query string.
-
When displaying the data that the user entered, display all the values that
were chosen in the checkbox group.
-
When displaying the data from the database, display all the values that were
chosen in the checkbox group, for each row.
-
Use the Apache stylesheet in all your JSPs for the project. The style sheet
only needs to appear when the project application is accessed from Apache.
When the site is accessed from Tomcat, the style sheet does not appear. Use
a relative reference to access the style sheet.