![]() |
iPlanet Web Server, Enterprise Edition Programmer's Guide to Servlets |
Appendix A Servlet Settings in magnus.conf and obj.conf
The iPlanet Web Server 6.0 Administration Server automatically modifies the magnus.conf and obj.conf files to load the servlet engine if servlets are enabled. Whenever you make changes to servlet settings by using the Server Manager interface, the system automatically updates these files appropriately.
However, in case you are interested in the settings that affect servlets, this appendix describes them in the following sections:
Init Directives in magnus.conf
Init Directives in magnus.conf
The following directives in the Init section of magnus.conf load and initialize the servlet engine to enable servlets (for Windows NT):
for Unix, the directives are the same except for the following parameter:
shlib="server_root/bin/https/lib/libNSServletPlugin.so"
NSServletEarlyInit takes an optional parameter, cache_dir, which specifies the location of a temporary cache directory for JSP classes. By default, the directory is named ClassCache and goes under your server root directory.
NSServletLateInit takes the following optional parameters:
Note The information in this section applies to legacy (iPlanet Web Server 4.x) servlets and is deprecated.
NSServletService takes two optional parameters, servlet="servlet_name" and context="context_name". These parameters allow you to define objects in obj.conf that generate responses for specific servlets or contexts. You can use one or both parameters in a directive. The servlet or context must be defined in the servlets.properties or contexts.properties file. You can define an object that pertains to a particular servlet, a particular servlet context, or both. For example, you can direct files of a specific type (in this case, *.foo) to a specific servlet (in this case, the wasp servlet):
For another way to direct files of a specific type to a specific servlet, see the description of the servlet-mapping element in the web.xml file, which is described in the Servlet 2.2 API specification:
http://java.sun.com/products/servlet/index.html
For a way to direct files of a specific type to a specific servlet as in iPlanet Web Server 4.x, see "Using Regular Expressions in rules.properties."
For an example of the basic use of NSServletService, see the discussion of Service examples in Chapter 2, "Syntax and Use of Obj.conf" in the NSAPI Programmer's Guide for iPlanet Web Server.
When servlets are enabled, the following directive appears in the default object:
NameTrans fn="NSServletNameTrans" name="servlet"
This directive is used for servlet virtual path translations and for the URI cache. Do not delete this line.
Also, obj.conf always has the following object, which you should not delete:
<Object name="servlet">
ObjectType fn=force-type type=text/html
Service fn="NSServletService"
</Object>
If you delete this object, you can no longer use the Server Manager interface to enable servlets and modify servlet settings.
For more information, see the NSAPI Programmer's Guide for iPlanet Web Server.
Directives for Registered Servlet Directories
Note The information in this section applies to legacy (iPlanet Web Server 4.x) servlets and is deprecated.
For each registered servlet directory, the default object in obj.conf has a NameTrans directive that assigns the name ServletByExt to all requests to access that directory. For example:
NameTrans fn="pfx2dir" from="/servlet" dir="D:/Netscape/Server4/docs/servlet" name="ServletByExt"
A separate object named ServletByExt has instructions for processing requests for servlets:
<Object name="ServletByExt">
ObjectType fn="force-type" type="magnus-internal/servlet"
Service type="magnus-internal/servlet" fn="NSServletService"
</Object>
Do not delete this object, even if no servlet directories are currently registered. If this object is deleted, you can no longer use the Server Manager interface to register servlet directories.
JSP Directives
The following line in mime.types sets the type for files with the extension .jsp:
type=magnus-internal/jsp exts=jsp
The following directive in obj.conf handles the processing of requests for files of type magnus-internal/jsp (that is, JSP files). It is necessary for legacy JSPs only.
Service fn="NSServletService" type="magnus-internal/jsp"
Previous Contents Index DocHome Next
Copyright © 2001 Sun Microsystems, Inc. Some preexisting portions Copyright © 2001 Netscape Communications Corp. All rights reserved.
Last Updated May 02, 2001