Java Web Server

Frequently Asked Questions (FAQ) About Servlets


Contents / New Features / Administrator Docs / Developer Docs / Index

The Servlets FAQ has the following questions:

  1. How do I pass arguments to the servlets?
  2. How long do servlets last?
  3. What servlets are currently part of the server?
  4. Why can't I compile a servlet?
  5. How do I set multiple properties?
  6. What is passed as ServletRequest for servlets invoked as server side include?

How do I pass arguments to the servlets?

Arguments to the servlets can be passed at two levels.

How long do servlets last?

Once activated, servlets live until the server exits or until the server calls the destroy method on the servlet. For servlets associated with servlet aliases, unmapping the alias will destroy the servlet, and subsequent access to the servlet will reload the servlet.

What servlets are currently part of the server?

See the Internal Servlets page, and the Sample Servlets page for information on some of the available servlets. Also look in the server_root/servlets directory of the release for more servlets.

Why can't I compile a servlet?

Make sure that your CLASSPATH is set to include the JavaTM Web ServerTM classes. This can be done at the command line (using java -classpath ....) or else in the environment variable.

How do I set multiple properties?

The following is the proper syntax:

test.Servlet.initArgs=\
fruit=apple,qty=5

What is passed as ServletRequest for servlets invoked as server side include?

SSIncludeServlet will clone its ServletRequest, and substitute the parameters embedded in the tag.


Top
java-server-feedback@java.sun.com
Copyright © 1997 Sun Microsystems, Inc.
All Rights Reserved.