CISC474, 06S, Homework 02 (H02)

Due Date/Grading

Due DateTBA
Points 50

Prerequisites

Reading

  1. HFSJ, Chapters 1 and 2, and Chapter 3 up through p. 71, and accompanying reading notes and errata
    (you'll can read pages 72-91 as you do the work in this homework assignment.)
  2. topics/java/basics/compliingOnPorsche.html to set up your ECL account for compiling with Java version 5.0
  3. topics/tomcat/generalInstallAdvice/sharedInstall.txt, including the new part at the end about setting up a Tomcat server on the clients of porsche.cis.udel.edu.

Assignments you should complete first

Your Task: Create your own MVC Servlet based on HFSJ Chapter 3

You should accomplish this task by following these steps:

  1. Do the required background reading (up through p. 71) including the reading notes for chapter 3. Then set up Tomcat on your porsche account by doing the following steps:

    1. Read over the file topics/java/basics/compliingOnPorsche.html for instructions for setting up your ECL account for compiling with Java version 5.0. Make sure that when you type "java -version" that what comes back looks like the following:

      porsche[51] > java -version                                             
      java version "1.5.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
      Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode)
      porsche[52] > 
      		  
      		  
    2. Read over the new material at the end of the file topics/tomcat/generalInstallAdvice/sharedInstall.txt for advice on how to set up your Tomcat server on one of the clients of porsche. You'll need also to consult the link on the CISC474 home page that lists the port assignments and machine assignments.

      You could test your new Tomcat server by either (i) copying the contents of the webapps directly from the $CATALINA_HOME directory, or (ii) by trying to deploy your Chapter 1 servlet, or (iii) do nothing—the next steps in this assignment involve deploying a servlet on this server, and you can wait until that step to see if your Tomcat install is working. I'll leave that choice up to you.

  2. Work through the first verson of the Beer-v1 Controlller Servlet (pp. 72-81) and deploy it on your porsche-based Tomcat server. (This version contains only the "C" in "MVC").

  3. Work through the model class, and the second version of the Beer-v1 Controller Servlet (pp. 82-85), and deploy this on your porsche-based Tomcat server (This version is only the "MC" part of "MVC").

  4. Continue with the view part (the JSP), and deploy the third version of the Beer-v1 Servlet (pp. 86-90) on your strauss-based Tomcat server (This is a full MVC version of your Beer-v1 servlet.)

  5. Now repeat this process, creating an MVC servlet that is similar in functionality to the Beer-v1 servlet, but works with your product you chose for your P03 assignment instead of Beer.

    Unlike the model class on p. 82, your model class should provide advice for at least four categories. It should return at least two answers for each category, and at least three answer for one of the four categories (these are the same requirements as your table for P03).

    Note that keeping your development and deployment environments separate is a requirement of the assignment. You may be asked to show this when you demo.

    Test and deploy your servlet on porsche. For the names of the directories in the development and deployment environment, the URL, the class name and "internal secret name" (see p.46 and p.77 in HFSJ) use names modelled after those chosen for the Beer-v1 servlet, but that are appropriate to your servlet (e.g. Skis-v1 or VideoGames-v1 instead of Beer-v1

  6. During lecture or office hours, demo your servlet to your instructor or TA. Your instructor/TA may ask to see your code also, and ask you to add or delete an item from your model, so be prepared to make a change, recompile, and redeploy. This might also be handled by email, so watch/listen for announcements in lecture and/or by email.
  7. Keep your code, since you'll be using it as the basis of a future assignment. Although you won't be graded on your code in this assignment, in a future assignment you will be submitting it for a grade, so style will count.

Grading Rubric

ItemDescription Points
Beer-v1 servlet works The servlet from Chapter 3 of Sebesta works. This is pretty much just "type it in and follow the instructions", so it is only worth 20% of the assignment. 10
Web App Works Student's web app does what it is supposed to do and doesn't crash or return an error 20
Following Directions Student followed directions for assignment (including keeping the development and deployment environments separate, and any other instructions given.) 10
Visual Appearance Produced web page is generally neat (it doesn't have to be a work of art, but it shouldn't be sloppy either) 10