Complete the following tasks:
-
Create a new Context in your Tomcat server.xml file for your
coursework this quarter. Name it after your DePaul id.
Mine, for example, would be mwright1. At a minimum, set the path,
docBase, debug, and reloadable attributes. Feel free to play around
with these as well.
-
Create your webapp directory according to the instructions in the notes,
or reference the Tomcat documentation for details. Add the WEB-INF
directory, and the classes directory in WEB-INF, etc.
-
Create a valid web.xml file.
- Write a servlet that reads initialization parameters and writes
valid html. It should read in at least two parameters and do something
interesting with them. For example, you could read in a parameter
(remember it's a string) and use it to loop a certain number of
times based on the parameter. Or, you could parse a date entered as a
parameter, and change the look of the page based on how far that date is
from today. The servlet should also be in a package. (se452.depaulid, where
depaulid is your id used to login to campusconnection, mwright1 in my case)
-
Make sure your servlet handles both GET and POST requests.
-
Edit web.xml so your servlet is called by a url that doesn't
contain the word "servlet" and is not the same name as your servlet
class name.
-
Create a simple index.html file and place it at the root of our webapp.
Provide a link in this file to run your test servlet, along with
a little description of what the user will see when it is executed.
-
Place the class file and source file in the correct location in
WEB-INF and test your servlet. When you are done, zip the
entire webapp (in my case, the mwright1 directory) and post it in the
COL submission area. Name the zip file the same as your userid
(ex. mwright1.zip).
-
Make sure to comment your source appropriately, including
@author and other appropriate javadoc tags.
Grading Breakdown:
Item | Points |
Context File | 10 |
web.xml settings | 10 |
index.html | 10 |
Webapp structure | 10 |
Coding style, javadoc | 10 |
Proper Submission | 10 |
Servlet functionality | 40 |
Total: | 100 |
Questions or problems? Try posting a question to the Discussion
forum on the DL web site.

