CGS4825 Assignment 1
Due Tuesday, 5/13 at 6 am.
To hand in the assignment, zip your cgs4825 directory and upload
it via the web:
Submitting
homework on-line via the Web.
-
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.
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.
You are to create a service oriented web site. You will be adding features
throughout the semester. 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.
Create a Web Application using NetBeans
-
Create a new web application in NetBeans, named your-username.
-
Use the secure web.xml file.
-
Create a welcome page named index.jsp. Be sure it uses the strict
DOCTYPE.
-
Validate the JSP at http://www.w3c.org.
-
Restrict access to this web site to you and me (this is controlled by the
secure web.xml file)
-
Create a JSP similar to InitialisedForm.jsp. Instead of the Hobby and Aversion
properties that are used in the book, pick your own properties. These properties
should be useful in the web site that you are developing. Do not use first
name and last name. Be creative. Think of a web site that you would like
to create and pick two properties that are specific to that type of service.
-
Validate the JSP at http://www.w3c.org.
-
In the index.jsp page, add a relative hypertext link to your JSP.
Configure the Tomcat server
-
Create and validate your webapps folder on ocelot and request your student
host.
-
Access the Tomcat server by using the student host that I send you:
http://student99.cgs4825.cs.fiu.edu:8008/
-
Access the manager application through the student host that I send you:
http://student99.cgs4825.cs.fiu.edu:8008/manager/html
Deploy the Web Application
-
In NetBeans, select Clean and Build to recreate all the files in your web
application. This will also create the WAR file for the web application.
-
Connect to
ocelot.aul.fiu.edu
using winscp. Your username is
your panther mail and the password is first initial, followed by panther
id, followed by last initial.
-
Navigate to the cgs4825 directory on ocelot.
-
Navigate to the directory on your local machine that contains your NetBeans
project, then open the dist folder.
-
Copy the WAR file from your local machine to the cgs4825 directory on ocelot.
-
Right click the name of the WAR file in the remote window of winscp. Select
Custom Commands and then Run. If the name of the war file is MyApp.war, then
enter the following command into the command box and hit enter. Replace
your-user-name with your user name.
unzip -o MyApp.war -d webapps/your-user-name
Modify index.jsp in the ROOT Web Application
-
In winscp, navigate to the
cgs4825/webapps/ROOT
folder.
-
Create a file named index.jsp.
-
Enter all the HTML tags for a standard page.
-
Use the strict DOCTYPE.
-
Validate the page at http://www.w3c.org.
-
Add a relative hypertext link to your username web application. Remember
that
/
on Tomcat means webapps/ROOT
in the file
system and /username
means webapps/username
in
the file system.
Access Web Application
-
You should now be able to access the ROOT web application with
http://student99.cgs4825.cs.fiu.edu:8008/
-
From this page, you should have a link to the root of your username web
application.
-
After clicking the link, you should have a link to the JSP for this assignment.
-
You can also access the manager with
http://student99.cgs4825.cs.fiu.edu:8008/manager/html
-
Try stopping the username web application, then try to access the application
from the web. You will receive an error.
-
Next, try starting the username web application, then try to access the
application from the web. You should now have access.