CGS4825, Assignment 5
Due Wednesday 12/7 at 11:59 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
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.
Server
Create your own error messages
-
Place error files in the errors directory of the serverRoot
for 403 and 404 errors.
Create a directory to test language negotiation
-
Create a directory named language in your docRoot directory.
-
Add three files to this directory, each will have the same name, except for
an additional language extension.
-
Place some content in each that agrees with the language for the page.
-
Be sure that each page does not get stuck in the cache.
Configure the server as follows
-
Add language negotiation to your server for the following languages. Remove
any other languages from your server.
-
Enable your own error messages
-
Add an alias to the errors directory in your serverRoot.
-
Configure the server so that it will use your error files for 403 and 404
errors. If you use Internet Explorer, you will need to change the advanced
options in the browser so that "friendly error messages" are not used.
-
Create the following aliases to the language directory.
-
Modify the appearance of each of these alias locations. Use access.conf
to control each location individually.
-
/fancy
-
Language negotiation should be on in this directory
-
Be sure that a directory list appears for the directory.
-
The directory list should be fancy.
-
Add a short description for each language.
-
Each language should use a different icon.
-
The directory list should not show the size of the files.
-
Add some content above the directory list that explains the page.
-
Add some content below the directory list that explains more about the page.
-
/plain
-
Fancy indexing will not be used in this directory.
-
Language negotiation will be on
-
Add some content above the directory list that explains the page.
-
Add some content below the directory list that explains more about the page.
-
/none
-
No directory listing will appear for this location. You will get a forbidden
error if you try.
-
Language negotiation should be off in this directory. You can still access
files in this directrory, but the server will not try to complete the file
name for you. If you type the full name of a file, you should be able to
access it.
Modify the index.html in the docRoot.
-
Add an unordered list of links
-
Add three links to the three aliased directories.
-
Add three links to the common name for all the files in each aliased directory.
The common name is the name that all three files share, omitting the final
language extension.
-
A link through the /fancy alias.
-
A link through the /plain alias.
-
A link through the /none alias
-
Add a link to a file (or directory) that does not exist.
-
Add a link to a file (or directory) that is forbidden.
-
Add a link to the root of your username web application on Tomcat.
Web Application
Modify the HW4 web application. If you have not finished it, then see me
for assistance.
-
Choose one of your form elements as the business key field for your
application. There will only be one record in the database with this value.
-
For a POST request
-
If there is a value in the query string for the business key, then search
the database for the value of that key
-
If the data is in the database, then retrieve that bean and clear the
collections, and clear all properties that use arrays.
-
Use this bean and populate it with the values that are in the query string.
By using the bean from the database, this will ensure that there is only
one record in the database that has this value for the business key.
-
If there is no value for the business key in the query string, then create
a new bean and populate it with the values from the query string.
-
When the data is written to the database, set a cookie for the business key
with its current value. The cookie should expire in one minute.
-
For a GET request
-
If there is a cookie for the business key, then search the database for the
value of the the cookie.
-
If the data is in the database, then use the bean from the database to initialize
the form.
-
If the data is not in the database, then create a new bean and populate it
with the values from the query string.
-
If there is not a cookie for the business key
-
If there is a value in the query string for the business key, then search
the database for the value of that key
-
If the data is in the database, then retrieve that bean and clear the
collections, and clear all properties that use arrays.
-
Use this bean and populate it with the values that are in the query string.
By using the bean from the database, this will ensure that there is only
one record in the database that has this value for the business key.
-
If there is no value for the business key in the query string, then create
a new bean and populate it with the values from the query string.