HW3: Forms and Servlets
Due: Tuesday 30 October 2001
[8 points]
The purpose of this homework is to give you some experience with
using forms to gather information from a web user and using sxml to
generate a web page using that information.
For this homework you are to
- write a program, hw3.html, which contains
the following elements:
- a form element with method=post and action="hw3.sxml"
- various input elements with type
- text
- password
- checkbox (several of these)
- radio (several of these)
- reset
- submit
- hidden (for passing data to the servlet that the user won't see)
- a select element with several options
- a select element with attributes "multiple" and "size=5" and
several options
Note: you should *not* use a textarea element, as it will interfere with the
textarea used in the U-method uploading form!
- write a servlet, hw3.sxml, which takes the data gathered by this form
and uses it to generate a web page. Your servlet should do the
following:
- set the page color using form input
- print the current date
(using <scheme>(Date.)</scheme> )
- do some calculation using the numbers supplied by the user
In addition, your servlet should do at least one of the following:
- maintain a counter of how many people have visited the page
and display this info
- log some data about each visit in a file in your folder
- send email to you containing some of the form data from the visit
Feel free to be creative!
Hint: start small and build your servlet up a little
at a time. This makes it easier to find and correct errors.
Feel free to copy any of the servlets shown in class and extend them
to meet the homework requirements.