CGS4854 Assignment for Chapter 2 Assignment

Due Friday, February 17 (not late until 8 am, 2/18)

You are to create a service oriented web site. You will be adding features throughout the semester. 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

  1. Create a new web application in NetBeans, named your-username (replace your-username with your user name).
    1. If there is not a web.xml file in the WEB-INF folder, then select New File -> Web -> Standard Deployment Descriptor (web.xml) from the NetBeans menu.
    2. Use the secure web.xml file.
    3. Restrict access to this web site to you and me (this is controlled by the secure web.xml file)
    4. Edit the tomcat users file so that you can access your app in your local NetBeans.
    5. Modify the index.jsp that is in the root of the web app. Be sure it uses the strict DOCTYPE (or the new, simpler HTML5 doctype).
    6. Add a paragraph of at least four sentences that describes service that you are providing.
    7. Validate the JSP at http://www.w3c.org.

Servlet Controller

Configure the Tomcat server

If you have not already received your host number from me, then do the following.

  1. Connect to ocelot
    1. Change the permission on the ~ folder to 705.
    2. Edit the .cshrc file that is located in your home directory. Add the following statement to the end of the file. Be sure to hit enter at the end of the line.
      umask 072
    3. Log out and then log in again. This will implement the change you just made. From now on, all your folders and files should be created with the correct permissions.
  2. Create and validate your webapps folder on ocelot and request your student host. You may use winscp to create the webapps. Use these step-by-step instructions to create the ROOT web app using winscp. Do similar steps to create the manager web app, but be sure to use the web.xml file for the manager.
  3. Access the Tomcat server by using the student host that I send you:
    http://student99.cgs4854.cs.fiu.edu:8008/
  4. Access the manager application through the student host that I send you:
    http://student99.cgs4854.cs.fiu.edu:8008/manager/html

Deploy the Web Application

  1. 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.
  2. Connect to ocelot.aul.fiu.edu using winscp (or another secure shell telnet program). Your username is your panther mail and the password is first initial, followed by panther id, followed by last initial.
  3. If you do not have one then, create a folder named cgs4854 on ocelot.
  4. Navigate to the directory on your local machine that contains your NetBeans project, then open the dist folder.
  5. Copy the WAR file from your local machine to the cgs4854 directory on ocelot. Do not copy the WAR file to the webapps folder.
  6. Right click the name of the WAR file in the remote window of winscp. Select Custom Commands and then select Enter. Be sure to check the box for Show Results in Terminal.
    If the name of the war file is your-user-name.war, then enter the following command into the command box and hit enter. Replace your-user-name with your user name. Replace your-user-name with your user name
    unzip -o your-user-name.war -d webapps/your-user-name

Modify index.jsp in the ROOT Web Application

  1. In winscp, navigate to the cgs4854/webapps/ROOT folder.
  2. Create a file named index.jsp.
  3. Enter all the HTML tags for a standard page.
  4. Use the strict DOCTYPE (or the HTML5 one).
  5. Validate the page at http://www.w3.org.
  6. 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.
  7. Add a relative hypertext link to the manager application. The absolute link to the manager is
    http://student99.cgs4854.cs.fiu.edu:8008/manager/html
  8. Add a paragraph of at least four sentences that describes your web site. This paragraph must be different from the other two that you have created.

Access the Web Application

  1. You should now be able to access the ROOT web application with
    http://student99.cgs4854.cs.fiu.edu:8008/
  2. From this page, you should have a link to the root of your username web application.
  3. After clicking the link, you should have a link to the JSP for this assignment.
  4. You can also access the manager with
    http://student99.cgs4854.cs.fiu.edu:8008/manager/html
  5. Try stopping the username web application, then try to access the application from the web. You will receive an error.
  6. Next, try starting the username web application, then try to access the application from the web. You should now have access.

Handing in the assignment

  1. To hand in the assignment, zip your cgs4854 directory and upload it via the web: Submitting homework on-line via the Web.
    1. Please use the following command to compress your cgs4854 folder. Change to your root directory on ocelot and issue the command
      zip -r username cgs4854 -x \*.jar \*.zip \*.war
      Replacing username with your user name.
    2. If you have any other archived files in your directory, like .rar, or .ZIP, or .WAR, please remove them before zipping.
    3. 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.
    4. Use my uploading program from ocelot to upload the file.
      ~downeyt/cs/public/webftp/webftp.pl
    5. Upload the file as binary.
  2. 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.