Running Oracle JSP on JSWDK 1.0
Running Oracle JSP on JSWDK 1.0
The JSWDK 1.0 is Java Software's JSP 1.0/Servlet 2.1 reference implementation. It
is available from the Java Software site at http://java.sun.com/products/servlet/index.html.
The following instructions assume you have successfully, installed the JSWDK and are able
run the built-in JSP samples using the built-in JSP engine. The instructions provide examples using Windows path
nomenclature. The instructions work equally as well for Solaris if you map to the Solaris path nomenclature.
To configure the JSWDK 1.0 to run Oracle JSP rather then the Java Software JSP engine
do the following:
- Copy Oracle JSP (ojsp.jar) into the jswdk-1.0/lib directory.
- Modify the startserver script in the jswdk-1.0 root directory to add ojsp.jar to the jspJars environment variable:
To enable XSL transformation from within a JSP page:
- Copy the Oracle XML parser (xmlparserv2.jar) into the jswdk-1.0/lib directory.
- Modify the startserver script in the jswdk-1.0 root directory to add xmlparserv2.jar to the miscJars environment
variable:
- miscJars=.\lib\xml.jar;.\lib\xmlparserv2.jar
- Restart the server.
To enable SQLJ translation from within a JSP page:
- Copy the SQLJ translator (translator.zip) into the jswdk-1.0/lib directory.
- Download and copy a JDBC driver into the jswdk-1.0/lib directory.
- Modify the startserver script in the jswdk-1.0 root directory to add these to the miscJars environment variable:
- miscJars=.\lib\xml.jar;.\lib\translator.zip;.\lib\classes111.zip
- Modify the mappings.properties file in jswdk-1.0\examples\web-inf to configure the Oracle JSP
servlet to handle sqljsp requests. In the following sample the JavaSoft configuration is commented out to
make it easy to switch between the two configurations.
- Restart the server.
Install the samples.
The samples are contained in the webroot directory. They should be copied somewhere beneath the webservers
document root directory. In a typical JSWDK installation this is examples.
Configuring the JspServlet.
The JspServlet requires no configuration/settings to run. However, its behavior can be tailored by setting the
following initparams in the servlets.properties file.
Common setting:
developer_mode: This flag controls the runtime behavior of the JSP engine. The values are true
or false. The default is true. If set to true the JSP engine will check whether to retranslate/reload
the requested page/application on every request. If set to false the JSP engine will only check whether
to translate when the initial request for the page/application is received. It is recommended that deployment environments
set developer_mode to false to maximize performance. For example:
jsp.initparams=developer_mode=false
translate_params: This flag let's you override servlet engines that don't encode mulitbyte (NLS) request
(form) parameters. The values are true or false. The default is false. If set to true
the JSP engine will encode the request parameters itself. If false, the JSP engine will return the parameters
from the servlet engine unchanged. When developing multibyte JSPs, it is important you determine if the servlet
environment you are running in supports multibyte request parameters or not. Setting translate_params
to true in an environment that correctly handles parameter encoding will yield incorrect results. For example:
jsp.initparams=translate_params=true
page_repository_root: By default, the JspServlet uses the Apache servers document repository to generate/load
translated JSPs. The generated .java/.class files are written into a special directory called _pages in the root
directory of the application this page is contained in. If the page is not contained in an application it is written
into the _pages subdirectory in the server's docroot directory. If you want a the JspServlet to generate pages
to a location outside the server's docroot set the page_repository_root initArg. The value of this argument
should be a fully qualifed path to the root directory into which pages will be generated/run. This directory need
not exist. For example:
jsp.initparams=page_repository_root=c:\jsps
classpath: By default, the JspServlet loads classes from either the system classpath or the page repository.
If additional class dependencies exist they can be specified using the classpath initArgs. The form for
specifying a classpath follows the conventions that the platform uses for specifying a regular Java classpath.
For example:
jsp.initparams=classpath=c:\somedir\myapp.jar
It is currently recommended that all dependent classes be included in the regular JServ classpath rather than
via this setting as this version is still workign through some class loader issues.
Uncommon settings:
page_provider_root: By default, the JspServlet uses the web servers document repository to locate the
.jsp file that corresponds to the incoming request. page_provider_root let's the JspServlet pull these files
from an alternative repository/location. It is primarily provided to support server's that don't use the filesystem
as their repository. It is not recommended that users set this initArgs when running on Apache.
page_provider: By default the JspServlet assumes pages are being delivered from/to a filesystem. This
is not universally true for all Oracle implementations. This setting let's you specify an alternative class to
be used as a page provider for the JspServlet. Currently there are no alternatives implemented.
page_repository: By default the JspServlet assumes generated pages are being delivered from/to a filesystem.
This is not universally true for all Oracle implementations. This setting let's you specify an alternative class
to be used manage a page repository for the JspServlet. Currently there are no alternatives implemented.
classloader: By default the JspServlet assumes classes are being loaded from a filesystem. This is not
universally true for all Oracle implementations. This setting let's you specify an alternative class to be used
implement a classloader for the JspServlet. Currently there are no alternatives implemented.
jspcompiler: By default the JspServlet uses the builtin Java compiler (javac). Pages are read directly
from the filesystem. In the future we plan to supprot in memory compilation as well as compiling out of different
repository types. This setting names the class that implements the JspCompiler interface. Currently there are no
alternatives implemented.
|