Servlet SetUp on CSU Chico machines

If you desire to run your own WebServer (and I suggest you do for easier debugging), I will presume that you can set up your own machines (i.e., I will not give you directions for downloading and setting up the server). I do, however, suggest either using

  1. Tomcat (since that is what is used here) Tomcat is used in Marty Hall's notes. Here is a page to help setup.
  2. the Application Server version provided with the J2EE download. This web server comes with a nice page to illustrate its use.

Whether you are local or offsite you should provide your servlet for grading on the machine here.

Below is the set up for users of the TomCat server already installed at CSUC on our Unix machines. Which you would access through accounts on the machine ect-unix.ecst.csuchico.edu which is also ect-sun.ecst.csuchico.edu which defaults to tiglon.ecst.csuchico.edu, IP address: 132.241.6.18

  1. Tell the system adminstrators here that you want permission to put servlets on our server. They will set you up in the necessary context. (You will need to already have an account there; if you don't - new accounts )

  2. Put your java servlet classes in the right place

  3. Under your public_html directory/subdirectories you can now put html pages that access your servlets. The html page should have all of the GUI stuff and should say where the servlet is (see 4). Remember that servlets are simply server-side applets. These html pages are what will access the servlet classes.
    So, remember, these html files do not need to be in the WEB-INF directory; the WEB-INF directory is for the servlet classes.

  4. Important: The html code should have the path of your web page but rather than the WEB-INF directory, it should say servlet

    Specifically, here is an example of a line that might be in your html file for a servlet class where the java code is at public_html/WEB-INF/classes/MyServlet.class:

    <form method="POST" action="http://www.ecst.csuchico.edu/~yourName/servlet/MyServlet"> Here is an example of a line that might be in your html file for a class MyServlet.class that is in the package myPackage at public_html/WEB-INF/classes/myPackage/MyServlet.class (the classes in this directory should be specified as in the package myPackage)

    <form method="POST" action="http://www.ecst.csuchico.edu/~yourName/servlet/myPackage.MyServlet">
      Compare to Tomcat CookieExample.class in directory
      C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\servlets-examples\WEB-INF\classes
      which runs off of html page
      http://127.0.0.1/servlets-examples/servlet/CookieExample

  5. Should work! Have fun. If you want to save the information to a file to later display, your web directory path format looks like <input type="hidden" name="FilePath" value="/var/www/yourName/yourwebDirectories/"> Notice no public_html here either. The /var/www/yourName/ corresponds to http://www.ecst.csuchico.edu/~yourName/

  6. And of course the submit and reset buttons <input type="submit" value="Submit Form" name="submit"> <input type="reset" value="Clear Form" name="clear">
I also have the Register.html file in the my directory and Register.class in my servlet directory.