There is not enough time left in the semester to do a major homework or project, but there is too much time left just to declare victory and "cancel the remaining three classes"—especially in a comprssed 10 week semester.
So, we will do a minor homework—one that is fairly "cookbook", but that will introduce you to an important Java-related technology: Servlets. Servlets are the building blocks of Java-based server-side web applications. They are used to drive many commerical web applications including RateMyProfessors.com, and Delta.com.
It is a pretty sure bet that you are using a Servlet/JSP-based application when you see .jsp or servlet in the URL.
Required Reading
This assignment assumes your strauss account is configured for Java 5.0, which it should already be.
In this assignment, you will:
The steps to set up a Tomcat server on strauss are provided in the file:
topics/tomcat/generalInstallAdvice/sharedInstall.txt
You'll need p. 30-31 of your textbook. You should also look at the reading notes for p.30 and p.31 which offer some advice on how to tailor the instructions p. 30-31 to the environment on strauss.
To show that this is your web app, modify the app just slightly: change the lines that says:
out.println("<html>" +
to say:
out.println("<html><head><title>Fred's Ch1 Servlet</title></head>" +
except, put your name, not Fred. Unless your name is Fred. You may also modify the part that says HF\'s Chapter 1 Servlet
inside the <h1> element to be Fred\'s Chapter 1 Servlet
if you like.
We'll give you some time in class during the next few class periods in which you can do this.
Or, you can just send us an email with subject line "CISC370 H05 Step 4 " and the URL of your app in the body.; we'll know it's yours because of the name in the Title bar. Once we've noted that it is working, we'll send a return email inviting you to shutdown your server (to conserve CPU cycles on strauss—that "funny money" that shows up when you log in.)
MVC is an example of a design pattern. According to Wikipedia, a design pattern is a "general repeatable solution to a commonly occurring problem in software design. " You will hear a lot about design patterns if you pursue a career in professional software development, so it is good to familiarize yourself with the concept.
These pages from Chapter 3 of HFSJ walk you, step-by-step, through the process of creating a servlet using the MVC design pattern. You'll then repeat that step to solve a "slightly different problem", to convince yourself, your instructor, and your TA, that the knowledge and skills you gained by working through Chapter 3 actually sunk in.
Work through the first verson of the Beer-v1 Controlller Servlet (pp. 72-81) and deploy it on your Tomcat server. (This version contains only the "C" in "MVC").
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").
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.)
When you are finished with the final Beer-v1 servlet, make a link to it the page 07J_H04 on the course wiki.
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 H03 assignment instead of Beer.
Note that keeping your development and deployment environments separate is a requirement of the assignment.
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
When it is finished, make a link to it from the 07J_H05 wiki page.
50 choice points: develop an Ant build.xml file that creates and deploys a WAR file
You can find some advice on how to do this by consulting the following assignment from CISC474:
http://www.udel.edu/CIS/474/pconrad/07S/hwk/H07.html
To get the choice points, you should do this work by the regular deadline, and include it in your submission.