Installing the Lab Assignment 2 (Servlets and Sockets)

1. Install Java

For this lab assignment we will use Java Development Kit 1.3.
Check if you have Java installed: java -version. If not, install it with:

module initadd prog/jdk/1.3.1_02

You will now be able to use Java next time you log into your computer.

2. Install the Java Servlet Development Kit (JSDK)

JSDK 2.0 is installed in ~trapo/JSDK2.0. Let the Java interpreter know where JSDK is located by setting the environment variable CLASSPATH:

setenv CLASSPATH .:/home/trapo/JSDK2.0/src

You might set the CLASSPATH in your .cshrc file so that you don't have to set it each time you work with servlets.

Copy all the servlet examples and the servlet.properties file in the directory created for the third lab assignment:

/home/<user>/TDDB37/lab2% cp /home/trapo/JSDK2.0/examples/* .

Compile all of the examples to make sure your java environment is sane:

/home/<user>/TDDB37/lab2% javac *.java

3. Using the "servletrunner"

We will not use Appache to execute the servlets. Instead, we will use a "servlet runner" provided with the JSDK. You can find details about the servletrunner in the "Servlet Tutorial" appendix. The documentation for the servlet packages is available from http://www.ida.liu.se/~TDDB37/labs/apidoc/packages.html.

A typical development session of a servlet looks like this: