http://www.javasoft.com/products/servlet/index.htmlNetscape Enterprise Server 4.0 includes all the files necessary for developing Java Servlets. The
servlets.jar
file is in the ES4.0 installation directory at:
/bin/https/jarWhen compiling servlets, make sure the
servlets.jar
file is accessible to your Java compiler.
http://www.javasoft.com/beans/index.html
NOTE: On Sun Solaris, the JRE included is the JRE 1.2.2 reference implementation from JavaSoft. For performance, it is recommended to use the latest SunSoft production release of JDK, currently 1.2.1_03.JDK 1.2 (and other JDK versions) are available from Sun Microsystems at:
http://www.javasoft.com/products/jdk/1.2/You can specify the path to the JDK in either of the following ways:
.jsp
extension as JavaServer Pages. (Do not put JSP files in a registered servlets directory, since the Enterprise Server expects all files in a registered servlet directory to be servlets.)
In detail, to enable the Netscape Enterprise Server to serve servlets and JSP pages, do the following:
obj.conf
. These directives first load the shared library containing the servlet engine, which is in NSServletPlugin.dll on Windows NT or NSServletPlugin.so on Unix. Then they initialize the servlet engine.
Init shlib="server_root/bin/https/bin/NSServletPlugin.dll/so"
funcs="NSServletEarlyInit,NSServletLateInit,NSServletNameTrans,NSServletService" shlib_flags="(global|now)" fn="load-modules"
Init EarlyInit="yes" fn="NSServletEarlyInit"
Init LateInit="yes" fn="NSServletLateInit"In the default object in
obj.conf
, add the following NameTrans
directive:
NameTrans fn="NSServletNameTrans" name="servlet"By default, regardless of whether servlets are enabled or disabled, the file
obj.conf
contains additional objects with names such as servlet
, jsp
, and ServletByExt
. Do not delete these objects. If you delete them, you will no longer be able to activate servlets through the Server Manager.
servlet.properties
in the server's config
directory.
The following code shows an example of the settings in servlet.properties
:
# General properties:
servlets.startup=hello
servlets.config.reloadInterval=5
servlets.config.docRoot=C:/Netscape/Server4/docs
servlets.sessionmgr=com.netscape.server.http.session.SimpleSessionManager
SimpleServlet.class
servlet is in the servlet
subdirectory of the server's document root directory, you can invoke the servlet by pointing the web browser to:
You can register any number of servlet directories for the Enterprise Server. Initially, the Enterprise Server has a single servlet directory, which is server_roothttp://
your_server
/servlet/SimpleServlet
/docs/servlet/
(For example, d:/netscape/server4/docs/servlet
.)
The Enterprise Server expects all files in a registered servlet directory to be servlets. The server treats every file,
in that directory with a .class
extension as a servlet. The Enterprise Server does not correctly serve other files, such as HTML files or JSPs, that reside in that directory.
The server can have multiple servlet directories. You can map servlet directories to virtual directories if desired. For example, you could specify that http://poppy.my_domain.com/products/
invokes servlets in the directory server_root
/docs/servlet/january/products/servlets/
.
To register servlet directories and to specify their URL prefixes, use the Servlets>Servlet Directory page in the interface.
Alternatively, you can register servlet directories by adding appropriate NameTrans
directives to the default object in the file obj.conf
, such as:
NameTrans fn="pfx2dir" from="/productss"
dir="d:/netscape/server4/docs/servlet/january/products/servlets/
"
name="ServletByExt"
servlet.properties
to add an entry for the servlet.
When registering an individual servlet, specify the following attributes:
.class
extension..jar
or .zip
file, or a URL to a directory.(You cannot specify a URL as a classpath for a zip or jar file.) buynow1A
resides in the directory D:/Netscape/server4/docs/servlet/buy/
. (Note that the final /
is omitted in the interface.) This servlet is configured under the name BuyNowServlet
. It takes additional arguments of arg1=45
, arg2=online
, arg3="quick shopping"
.
Figure 1.1 Configuring attributes for an individual servlet
The following code shows an example of the configuration information for the same servlet inservlet.properties
:
servlet.BuyNowServlet.classpath=D:/Netscape/server4/docs/servlet/buyNote that you can specify multiple values as the servlet classpath if needed.
servlet.BuyNowServlet.code=BuyNow1A
servlet.BuyNowServlet.initArgs=arg1=45,arg2=online,arg3="quick shopping"
http://poppy.my_domain.com/plans/plan1
invokes the servlet defined in the directory
server_root/docs/servlets/plans/releaseA/planP2Version1A.class
You can set up servlet virtual paths for servlets that reside anywhere, be it on a local or remote file system, and be it in or out of a registered servlet directory.
To specify a servlet virtual path, use the Servlets>Configure Servlet Virtual Path Translation page in the Server Manager interface. In this page, specify the virtual path name and the servlet name. You can alternatively manually edit the rules.properties
configuration file to add a servlet virtual path. Only servlets for which a virtual path has been set up can use initial arguments (See "GenericServlet.getInitParameter() and getInitParameterNames()" for iinformation about initial arguments.)
Before using a servlet virtual path, a servlet identifier must be added for the servlet in the Servlets>Configure Servlet Attributes page of the interface (or in the servlets.properties
configuration file).
http://poppy.my_domain.com/plans/plan1invokes the servlet defined in
server_root/docs/servlet/plans/releaseA/planP2Version1A.class.1. Specify the servlet identifier, class file, and class path. In the Servlets>Configure Servlet Attributes page in the interface, do the following:
plan1A
. (Notice that this is not necessarily the same as the class file name)..class
extension is not required.D:/netscape/server4/docs/servlet/plans/releaseA
.)Figure 1.2 Specifying the servlet name, code, and class path
To make this change programmatically, add the following lines to the configuration fileservlet.properties
:
servlet.plan1A.classpath=D:/Netscape/server4/docs/servlet/plans/releaseA/
servlet.plan1A.code=planP2Version1A2. Specify the virtual path for the servlet. In the Servlets>Configure Servlet Virtual Path Translations page, do the following:
/plans/plan1
to specify the virtual path http://poppy.mcom.com/plans/plan1
.plan1A
. Figure 1.3 Adding a virtual path
To do this programmatically, add the following line torules.properties
:
/plans/plan1=plan1AAfter this virtual servlet path has been established, if a client sends a request to the server for the
URL http://poppy.my_domain.com/plans/plan1
, the server sends back the results of invoking the servlet in server_root/docs/servlet/plans/releaseA/plan2PVersion1A.class
.
http://www.javasoft.com/products/jdk/1.2/
Enterprise Server 4.0+ requires you to use an official version of JDK1.2 on Solaris and NT. On HP, AIX and IRIX use JDK 1.1.Regardless of whether you choose to install the JRE or specify a path to the JDK during installation, you can tell the Enterprise Server to switch to using either the JRE or JDK at any time, by using the "Configure JRE/JDK Paths" page in the Servlets tab. You can also change the path to the JDK in this page. This page has the following fields:
/https-admserv/start-jre
.
If the server is currently using the JRE, this file has a variable NSES_JRE.
To enable the server to use a JDK, add the variable NSES_JDK
whose value is the JDK directory. You'll also need to change the value of the NSES_JRE
variable.
If you're using JDK 1.2 or greater, NSES_JDK
should point to the installation directory for the JDK, while NSES_JRE
should point to the JRE directory in the installation directory for JDK (that is, jdk_dir/jre
). For JDK 1.1.x, NSES_JDK
and NSES_JRE
should both point to the installation directory for the JDK. extrapath
setting in magnus.conf
.
Edit the NSES_JDK
and NSES_JRE
variables in the registry HKEY_LOCAL_MACHINE/SOFTWARE/Netscape/Enterprise/4.0/
. If the server is enabled to use the JDK, both these variables are needed. If the server is to use the JRE, only the NSES_JRE
variable should be set. If you're using JDK 1.2 or greater, NSES_JDK
should point to the installation directory for the JDK, while NSES_JRE
should point to the JRE directory in the installation directory for JDK (that is, jdk_dir/jre
). For JDK 1.1.x, NSES_JDK
and NSES_JRE
should both point to the installation directory for the JDK. .java
and a .class
file associated with the JSP and stores them in the JSP class cache, in a directory structure under the ClassCache
directory.MMapSessionManager
session manager, it stores persistent session information in the SessionData
directory. (For more information about session managers, see Appendix A, "Session Managers.")version
file containing a version number that the server uses to determine the structure of the directories and files in the caches. You can clean out the caches by simply deleting the version file.
When the server starts up, if it does not find the version files, it deletes the directory structures for the corresponding caches and re-creates the version files. Next time the server serves a JSP page, it recreates the JSP class cache. The next time the server serves a JSP page or servlet while using MMapSessionManager
session manager, it recreates the session data cache.
If a future upgrade of the server uses a different format for the caches, the server will check the number in the version file and clean up the caches if the version number is not correct.
You can delete the version files simply by deleting them from the ClassCache
or SessionData
directories as you would normally delete a file or you can use the Servlets>Delete Version Files page in the Server Manager to delete them. After deleting one or both version files, be sure to restart the Enterprise Server to force it to clean up the appropriate caches and to recreate the version files before the server serves any servlets or JSPs.
JVM.conf
(or JVM11.conf
or JVM12.conf
, depending on which version of JVM is being used).
The default settings in Enterprise Server for JVM are suitable for running servlets. However, there may be times when you want change the settings. For example, if a servlet or bean file uses a JAR file, add the JAR location to the Classpath variable. To enable the use of a remote profiler, set the OPTITDIR and Profiler variables.
The JVM parameters you can set are:
The classpath must not include backslashes in directory names. If you use backslashes in the directory path in the interface, the system automatically converts the backslashes to forward slashes. However, if you edit thejmv.conf
(orjvm11.conf
orjvm12.conf
) file, do not use backslashes in directory names.
Last Updated: 08/12/99 12:39:23
Copyright © 1999 Netscape Communications Corp. All rights reserved.