Romulus Tomcat servlet/jsp instructions

Please follow these steps to use servlets on romulus.rutgers.edu:
  1. You must be in Computer Science 336, 442 or 476 in order to use servlets.

  2. Login to romulus (Tomcat only runs on romulus, not remus).

  3. Run /usr/local/bin/nservletuser to setup your access to servlets. That will create directories named jsp and servlets in your home directory.

    If nservletuser prints an error message (about not being able to create the directories or anything else), please send email to help@romulus.rutgers.edu. If nservletuser says you are are not authorized to run servlets, go to http://remus.rutgers.edu/newaccount.html to update your account to cs336, cs442 or cs476.

  4. Make sure you are using the right version of the Java compiler or you may get compile errors about not being able to find various servlet classes.

    Run the command "which javac". If it prints /usr/local/bin/javac then you are using the right version. If it prints something else, make sure you always use the command "/usr/local/bin/javac YourFile.java" to compile your classes. If you get the wrong version, you could also add /usr/local/bin to the front of your path in your .login or .cshrc file, log out, and then log back in again. Then run "which javac" again and it should give the right version of javac (and you won't always have to type /usr/local/bin/javac to compile).

  5. To access your servlets they must be in your ~/servlets directory and they must be protected so the Tomcat server (and all other users) can read them. The easiest way to do this is to use the install-servlet script to copy your servlet .class files into your servlets directory. Just run "install-servlet YourFile.class".

    You can also use the regular Unix cp command instead of install-servlet, but you have to make sure all of the file access protections are set correctly. Your .class file must be protected so everyone can read it and your umask must be set to 022, not 077. If you copy your .class file into your servlets directory and Tomcat can't read it, Tomcat will ignore the file and give you 404 errors even if you change the protection so it can read it.

  6. Once your servlets are installed in your ~/servlets directory, you can access them with the URL http://romulus.rutgers.edu:8080/your_user_name/servlet/your_servlet_name. Note the lack of the 's' in the URL. Your directory has the 's', your URL DOES NOT!

  7. To access JSP files, copy your .jsp files into your ~/jsp directory and then use the URL http://romulus.rutgers.edu:8080/your_user_name/jsp/filename.jsp.

  8. Now you need to set environment variables. Yangzhe Xiao's classes do this...
    open file .cshrc /*assume using tcsh shell */
    Add the following lines to .cshrc. Skip the first two lines if you have already set $ORACLE_HOME/bin.
    ###start
    setenv ORACLE_HOME /koko/system/oracle/product/10.1.0
    setenv PATH $PATH\:$ORACLE_HOME/bin
    
    setenv PATH /usr/local/bin:$PATH
    setenv CLASSPATH /koko/system/oracle/product/10.1.0/jdbc/lib/ojdbc14_g.jar:/webserver/jakarta-home/jakarta-servletapi-4/lib/servlet.jar:.
    setenv JAVAVERSION 1.4.1
    
    ###end
    

If you need help you can reach us at help@remus