Advanced Java Programming: Lab 3 Servlets

Your servlet should
  1. make use of a form for user input
  2. do some processing with the user input (database connection would be good choice - see here for access to database)
    * if your processing is something other than connect your servlet to a database, you should discuss the complexity with me ahead of time to ensure credit
  3. return a specialized html page reply
  4. use persistance
Make sure to provide the standard documentation: Object Model, API pages with ADT's, Source, Readme with interesting information about your lab.
     Advanced Java Lab 3: Servlets
     Worth 10 points as follows:

Design and Object Model: 1 point
Documentation (inline and ADT info): 1 point
Readme: 2 points
Implementation: 6 points
(1.5 points for each of the above specs)
You have three options for providing a running servlet (suggest 1 or 2)
  1. you run it on the campus UNIX server (make sure all testing is complete and only put on our server when no further edits are needed)
  2. it runs on your own server (e.g., Tomcat on your machine) and I can access it
  3. you have it running properly using Eclipse and provide me with your eclipse Project or a WAR file to put into Eclipse

If your lab has sufficient complexity and you run it on a server other than Eclipse to demo, you may receive extra credit.

On our UNIX machines at CSUC we have Tomcat running. You should be able to put your servlets on our server but currently we are only running version 3 so it is quite possible that your java 1.5 code may not work as expected. It is probably best to download Tomcat yourself and test it locally first. See below for having me download and run on my server.

IF you want to try our local machine (UNIX running Tomcat):

  1. Update your existing account to get Tomcat/Servlets
  2. make a directory under your public_html and call it WEB-INF
  3. make a sudirectory named classes under WEB-INF
  4. your compiled servlet classes should be there.
    Here is an example of the form tag in your html page to access the servlet: where MyServlet.class is in WEB-INF/classes


Off-site maybe possibility for turn-in:

  • you provide all things necessary (in the format specified below) to run on my server (a good readme such as Joseph's to set up)
    NOTE: If you want me to run your servlet on my machine
    If you cannot run them on our CSUC server you should make a nice readme and package all of your servlet resources beautifully into a .war file, I will allow you to submit it and I will download it to my Tomcat server. To run it, I should not have to do anything other than put your war file into my webapps directory and follow your readme. Specifically: