CS2a/Spr09: Introduction to Computers
HW6 - Database-backed Servlets

HW6: Database-backed Servlets
due Wednesday 4/8/2009, 11:59pm
100 points

In this homework you will create a database backed web survey on a topic of your choosing. You can use my survey as a starting point:
http://popper.cs-i.brandeis.edu:8088/tim/cs2aspr09/home/tjhickey/hw6
The survey will ask the user a few questions and send the data to a servlet which will store their information in a database table and also send them a confirmation email. Finally there will be a webpage they can visit to see an analysis of the results of the survey. In addition to these three pages, you will also need to create a servlet to define a template for these hw6 files, and a css page defining the style, and a servlet to create the database table where the results are stored. The details are described below. You should be able to modify the code I have given without too much difficulty, so this should be easier than it sounds at first.

You may work on this homework in groups of 2 or 3. If you do so, then you should put all of your names in the template so that your names all appear on each page of your hw3 assignment. Also, all of the files should be in a folder named hw6, and should only be in one of the group members folders.

You are to create a folder called hw6 inside your class server space (on the popper.cs-i.brandeis.edu:8088 server) by visiting the URL

http://popper.cs-i.brandeis.edu:8088/tim/cs2aspr09/home/YOURUNETID/hw6/hw6init.servlet.
except that you use your unetid instead of YOURUNETID. You will need to create the following files in this folder:
hw6init.servlet 
hw6initdb.servlet 
hw6.css     
hw6a.html
hw6b.servlet      
hw6c.servlet      
The requirements for these files are described in detail below.

hw6init.servlet

This creates a template for all your hw6 pages whis contains links to the files and to their source (with V suffix)

hw6.css

This define the style for your template

hw6initdb.servlet

This creates a table to contain the information collected in hw6a.html you should include your unetid in your table name so that it doesn't conflict with anyone else's table.

hw6a.html

This contains a form that asks the user a few questions about some topic. it should then send that information to hw6b.servlet. This should collect at least 5 items information, including their unetid, their age, and sex.

hw6b.servlet

This takes all info collected and stores it in the table you have created. it should also send an email to the user, thanking them for participating in the survey, and showing them the information they entered into the survey. If the user info is #null, this should generate an error. Finally, it should generate a response page with a link to hw6c.servlet, the results page

hw6c.servlet

This should generate several tables which show the distribution of values for each survey question
Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 2.0 Generic License