Configuring Servlets in the Default Virtual Server
Chapter 8 Legacy Servlet and JSP Configuration 83
Registering Individual Servlets
The iPlanet Web Server treats any file in a registered servlet directory as a servlet.
There is no need to register individual servlets that reside in these directories
unless any of the following criteria apply:
• The servlet takes input parameters that are not passed through the request
URL.
• You want to set up additional virtual URLs for the servlet.
• Your servlets are packaged or in a
.jar file. The server does not search .class
or
.jar files for packaged servlets.
If any of these conditions is true, register the individual servlet by using the Legacy
Servlets>Configure Servlet Attributes page in the Server Manager interface.
Alternatively, you can edit the file
servlets.properties to add an entry for the
servlet.
When registering an individual servlet, specify the following attributes:
• Servlet Name -- The iPlanet Web Server uses this value as a servlet identifier to
internally identify the servlet. (This identifier is not part of the URL that is used
to invoke the servlet, unless by coincidence the identifier is the same as the
class code name.)
• Servlet Code (class name) -- the name of the class file. You do not need to
specify the
.class extension.
• Servlet Classpath -- This is the absolute pathname or URL to the directory or
zip/jar file containing the servlet. The classpath can point anywhere in the file
system. The servlet classpath may contain a directory, a
.jar or .zip file, or a
URL to a directory. (You cannot specify a URL as a classpath for a zip or jar
file.)
If the servlet classpath is not a registered servlet directory, you must
additionally provide a servlet virtual path for it (as discussed in “Specifying
Servlet Virtual Paths,” on page 84) to make the servlet accessible to clients.
iPlanet Web Server supports the specification of multiple directories, jars, zips,
and URLs in the servlet classpath.
• Servlet Args -- a comma delimited list of additional arguments for the servlet if
required.
The following code shows an example of the configuration information for the
same servlet in
servlets.properties:
Komentáře k této Příručce