The JavaTM Tutorial
Previous Page Lesson Contents Next Page Start of Tutorial > Start of Trail > Start of Lesson Search
Feedback Form

Trail: Servlets
Lesson: The servletrunner Utility

Starting the Server (JSDK2.1)

Like the servletrunner utility from the JSDK2.0, the server included with the JSDK2.1 is a small, multithreaded process that can run one or more servlets.

Unlike some web servers, the JSDK server does not automatically reload updated servlets. However you can stop and restart the server with very little overhead to run a new version of a servlet.

This section shows you how to

Preparing to Start the JSDK Server

Before you run the JSDK server, you must have a compliant JDK:

It is also possible for you to configure various properties of the JSDK server before you start it. These properties include the server's port, which defaults to 8080, the hostname of the server, which defaults to localhost, and the document root, which defaults to the webpages subdirectory of the JSDK installation. To see or update these configuration values, edit the default.cfg file in the JSDK installation directory.

Finally, note that the servlets directory is located at:

    doc_root/WEB-INF/servlets

Starting the JSDK Server

To start the server, use the Unix-based Korn-shell script or the Windows-based batch file that the JSDK provides in the installation directory of the JSDK.

The following command starts the server on Unix:

     % startserver

And the following command starts the server on Windows:

     C:\jsdk\> startserver

Once the JSDK server is executing, you can use it to test your servlets.

Stopping the JSDK Server

To stop the server, the JSDK provides shut-down commands in the same directory as the start-up commands (the installation directory of the JSDK).

The following command stops the server on Unix:

     % stopserver

And the following command stops the server on Windows:

     C:\jsdk\> stopserver

Previous Page Lesson Contents Next Page Start of Tutorial > Start of Trail > Start of Lesson Search
Feedback Form