OracleJSP Support for JavaServer Pages Developer's Guide and Reference Release 1.1.2.3 Part Number A90208-01 |
|
This appendix provides general information about installing OracleJSP, configuring the Web server to run OracleJSP, and configuring OracleJSP. The technical information focuses on common Web servers and servlet environments:
For Oracle environments that support OracleJSP, reference is made to documentation for those products for installation and configuration instructions.
For the Oracle9i Servlet Engine, translation-time configuration is handled through options of the OracleJSP pre-translation utility, as described in "The ojspc Pre-Translation Tool".
This appendix includes the following topics:
OracleJSP is a pure Java environment. The system on which you install it must meet the following minimum requirements.
Note:
The servlet library for your servlet environment must be installed on your system and included in the classpath in your Web server configuration file. This library contains the standard
For example, in an Apache/JServ environment (including the Oracle9i Application Server), you will need See "Configuration of Web Server and Servlet Environment to Run OracleJSP" for further discussion of classpath settings in a Web server configuration file. |
This section discusses OracleJSP installation and related Web server configuration for various JSP environments. The following environments are considered:
This discussion assumes that your target system, which might be either a development environment or a deployment environment, meets the requirements specified in "System Requirements". It also assumes that you have verified you can do the following:
javac
)
This section summarizes JAR and ZIP files required for OracleJSP, as well as optional JAR and ZIP files to use Oracle JDBC and SQLJ functionality, JML or SQL custom tags, or custom data-access JavaBeans. The summary of files is followed by a discussion of how to install OracleJSP files on non-Oracle environments, and a list of Oracle environments that already provide OracleJSP.
Required files must also be added to your classpath. (See "Add OracleJSP-Related JAR and ZIP Files to Web Server Classpath".)
Note: Refer to the Oracle9i Java Developer's Guide for the locations of these files on the Oracle9i product CD. |
The following files are provided with OracleJSP and must be installed on your system:
ojsp.jar
(OracleJSP)
xmlparserv2.jar
(for XML parsing--required for the web.xml
deployment descriptor and any tag library descriptors)
servlet.jar
(standard servlet library, servlet 2.2 version)
In addition, if your JSP pages will use Oracle JSP Markup Language (JML) tags, SQL tags, or data-access JavaBeans, you will need the following files:
ojsputil.jar
xsu12.jar
, for JDK 1.2.x, or xsu111.jar
, for JDK 1.1.x (in OSE, or for XML functionality on the client)
To run in the Oracle9i Servlet Engine, xsu12.jar
or xsu111.jar
must be installed prior to or simultaneously with ojsputil.jar
. (This should be handled automatically in a normal Oracle9i installation.) To run in a client environment, however, xsu12.jar
or xsu111.jar
is required only if you will use XML functionality in the data-access JavaBeans (such as getting a result set as an XML string). The xsu12.jar
and xsu111.jar
files are included with Oracle9i.
For Oracle data access, you will also need the following:
See "Files for JDBC (optional)" and "Files for SQLJ (optional)" for more information.
To use JDBC data sources or Enterprise JavaBeans, you will need the following:
(This file is required for some of the OracleJSP demos.)
Note that OracleJSP 1.1.x releases require and supply the 2.2 version of the servlet library, which is where the standard javax.servlet.*
packages are located. Your Web server environment likely requires and supplies a different servlet library version. You must be careful in your classpath to have the version for your Web server precede the version for OracleJSP. "Add OracleJSP-Related JAR and ZIP Files to Web Server Classpath" further discusses this.
Table A-1 summarizes the servlet library versions. Do not confuse the Sun Microsystems JSWDK (JavaServer Web Developer's Kit) with the Sun Microsystems JSDK (Java Servlet Developer's Kit).
(For Apache/JServ, download jsdk.jar
separately.)
The following files are required if you will use Oracle JDBC for data access. (Be aware that Oracle SQLJ uses Oracle JDBC.)
or:
The following files are necessary if your JSP pages use Oracle SQLJ for their data access:
as well as the appropriate SQLJ runtime:
or:
or:
or:
or:
runtime-nonoracle.zip
or .jar
(generic--for use with non-Oracle JDBC drivers and any JDK environment)
(The JDK 1.2.x enterprise edition allows datasource support, in compliance with the SQLJ ISO specification.)
To run OracleJSP in a non-Oracle environment--typically Apache/JServ, the Sun Microsystems JSWDK, or Tomcat--download the OracleJSP files from the Oracle Technology Network (OTN) at the following URL:
http://technet.oracle.com/tech/java/servlets/index.htm
Click on "Software" in the button bar near the top of this page.
You will need an OTN account, but membership is free of charge. Click on "Membership" in the bar at the top of the page if you do not already have an account.
For the OTN download, OracleJSP files are contained within ojsp.zip
, which includes files mentioned in this section, configuration files discussed later in this appendix, release notes, documentation files, and sample applications.
Installation and configuration instructions are included in ojsp.zip
--see install.htm
for top-level information and links. However, you can use this appendix for detailed information about configuring the predominant non-Oracle Web server environments--Apache/JServ, the Sun Microsystems JSWDK, and Tomcat--to use OracleJSP.
You can choose any desired root directory for OracleJSP, as long as the location you choose is reflected in your Web server classpath settings (discussed in "Add OracleJSP-Related JAR and ZIP Files to Web Server Classpath").
Oracle JDBC and SQLJ files are also available from OTN separately at the following URL:
http://technet.oracle.com/tech/java/sqlj_jdbc/index.htm
Click on "Software" in the button bar near the top of this page.
(Alternatively, if you have an appropriate Oracle product CD such as for the Oracle9i database, Oracle9i Application Server, Oracle Web-to-go, or Oracle JDeveloper, you can get OracleJSP files from that CD and place them as desired.)
The following Oracle environments provide OracleJSP and a Web server or Web listener, starting with the release numbers noted:
In any of these environments, OracleJSP components are included with the product installation.
If you are targeting OSE you will need a client-side development and testing environment--probably Oracle JDeveloper or perhaps a non-Oracle development tool. When you have completed preliminary testing in your development environment, you can deploy JSP pages to Oracle9i, as described in Chapter 6, "JSP Translation and Deployment".
Configuring your Web server to run OracleJSP pages requires the following general steps:
.jsp
and .JSP
and, optionally, .sqljsp
and .SQLJSP
) to the Oracle JspServlet
, which is the front-end of the OracleJSP container.
These steps apply to any Web server environment, but the information in this section focuses on the most prevalent non-Oracle environments-- Apache/JServ, the Sun Microsystems JSWDK, and Tomcat.
The Oracle9i Servlet Engine, provided with Oracle9i, is automatically configured upon installation to run OracleJSP, other than the steps documented in "Additional Steps to Run Servlets and JSP Pages in OSE". For other Oracle environments, refer to the documentation for those products, because procedures vary. (Much of the installation and configuration may be automatic.)
You must update the Web server classpath to add JAR and ZIP files that are required by OracleJSP, being careful to add them in the proper order. (In particular, you must be careful as to where you place the servlet 2.2 version of servlet.jar
in the classpath, as described below.) This includes the following:
ojsp.jar
xmlparserv2.jar
servlet.jar
(servlet 2.2 version)
(Note that the servlet.jar
supplied with OracleJSP is identical to the servlet.jar
provided with Tomcat 3.1.)
ojsputil.jar
(optional, for JML tags, SQL tags, and data-access JavaBeans)
xsu12.jar
, for JDK 1.2.x, or xsu111.jar
, for JDK 1.1.x (optional, for JML tags, SQL tags, and data-access JavaBeans)
See "Summary of Files" for additional information.
In an Apache/JServ environment, add appropriate wrapper.classpath
commands to the jserv.properties
file in the JServ conf
directory. Note that jsdk.jar
should already be in the classpath. This file is from the Sun Microsystems JSDK 2.0 and provides servlet 2.0 versions of the javax.servlet.*
packages that are required by Apache/JServ. Additionally, files for your JDK environment should already be in the classpath.
The following example (which happens to use UNIX directory paths) includes files for OracleJSP, JDBC, and SQLJ. Replace [Oracle_Home]
with your Oracle Home path.
# servlet 2.0 APIs (required by Apache/JServ, from Sun JSDK 2.0): wrapper.classpath=jsdk2.0/lib/jsdk.jar # # servlet 2.2 APIs (required and provided by OracleJSP): wrapper.classpath=[Oracle_Home]/ojsp/lib/servlet.jar # OracleJSP packages: wrapper.classpath=[Oracle_Home]/ojsp/lib/ojsp.jar wrapper.classpath=[Oracle_Home]/ojsp/lib/ojsputil.jar # XML parser (used for servlet 2.2 web deployment descriptor): wrapper.classpath=[Oracle_Home]/ojsp/lib/xmlparserv2.jar # JDBC libraries for Oracle database access (JDK 1.2.x environment): wrapper.classpath=[Oracle_Home]/ojsp/lib/classes12.zip # SQLJ translator (optional): wrapper.classpath=[Oracle_Home]/ojsp/lib/translator.zip # SQLJ runtime (optional) (for JDK 1.2.x enterprise edition): wrapper.classpath=[Oracle_Home]/ojsp/lib/runtime12.zip
Now consider an example where you have the following useBean
command:
<jsp:useBean id="queryBean" class="mybeans.JDBCQueryBean" scope="session" />
You can add the following wrapper.classpath
command to the jserv.properties
file. (This example happens to be for a Windows NT environment.)
wrapper.classpath=D:\Apache\Apache1.3.9\beans\
And then JDBCQueryBean.class
should be located as follows:
D:\Apache\Apache1.3.9\beans\mybeans\JDBCQueryBean.class
Update the startserver
script in the jswdk-1.0
root directory to add OracleJSP files to the jspJars
environment variable. Append them to the last .jar
file listed, using the appropriate directory syntax and separator character for your operating system, such as a colon (":"
) for UNIX or a semi-colon (";"
) for Windows NT. Here is an example:
jspJars=./lib/jspengine.jar:./lib/ojsp.jar:./lib/ojsputil.jar
This example (with UNIX syntax) assumes that the JAR files are in the lib
subdirectory under the jswdk-1.0
root directory.
Similarly, update the startserver
script to specify any additional required files in the miscJars
environment variable, such as in the following example:
miscJars=./lib/xml.jar:./lib/xmlparserv2.jar:./lib/servlet.jar
This example (with UNIX syntax) also assumes that the files are in the lib
subdirectory under the jswdk-1.0
root directory.
For Tomcat, the procedure for adding files to the classpath is more operating-system dependent than for the other servlet environments discussed here.
For a UNIX operating system, copy the OracleJSP JAR and ZIP files to your [TOMCAT_HOME]/lib
directory. This directory is automatically included in the Tomcat classpath.
For a Windows NT operating system, update the tomcat.bat
file in the [TOMCAT_HOME]\bin
directory to individually add each OracleJSP file to the CLASSPATH
environment variable. The following example presumes that you have copied the files to the [TOMCAT_HOME]\lib
directory:
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\ojsp.jar;%TOMCAT_HOME%\lib\ojsputil.jar
The servlet 2.2 version of servlet.jar
(the same version that is provided with OracleJSP) is already included with Tomcat, so it needs no consideration.
You must configure the Web server to be able to do the following:
Map .jsp
and .JSP
. Also map .sqljsp
and .SQLJSP
if your JSP pages use Oracle SQLJ.
In OracleJSP, this is oracle.jsp.JspServlet
, which you can think of as the front-end of the Oracle JSP container.
In an Apache/JServ environment, mapping each JSP file name extension to the Oracle JspServlet
requires just a single step. In the JServ conf
directory, update the configuration file--jserv.conf
or mod_jserv.conf
--to add ApJServAction
commands to perform the mappings.
(In older versions, you must instead update the httpd.conf
file in the Apache conf
directory. In newer versions, the jserv.conf
or mod_jserv.conf
file is "included" into httpd.conf
during execution--look at the httpd.conf
file to see which one it includes.)
Following is an example (which happens to use UNIX syntax):
# Map file name extensions (.sqljsp and .SQLJSP are optional). ApJServAction .jsp /servlets/oracle.jsp.JspServlet ApJServAction .JSP /servlets/oracle.jsp.JspServlet ApJServAction .sqljsp /servlets/oracle.jsp.JspServlet ApJServAction .SQLJSP /servlets/oracle.jsp.JspServlet
The path you use in this command for oracle.jsp.JspServlet
is not a literal directory path in the file system. The path to specify depends on your Apache/JServ servlet configuration--how the servlet zone is mounted, the name of the zone properties file, and the file system directory that is specified as the repository for the servlet. ("Servlet zone" is an Apache/JServ term that is similar conceptually to "servlet context".) Consult your Apache/JServ documentation for more information.
In a JSWDK environment, mapping each JSP file name extension to the Oracle JspServlet
requires two steps.
The first step is to update the mappings.properties
file in the WEB-INF
directory of each servlet context to define JSP file name extensions. Do this with the following commands:
# Map JSP file name extensions (.sqljsp and .SQLJSP are optional). .jsp=jsp .JSP=jsp .sqljsp=jsp .SQLJSP=jsp
The second step is to update the servlet.properties
file in the WEB-INF
directory of each servlet context to define the Oracle JspServlet
as the servlet that begins JSP processing. In addition, be sure to comment out the previously defined mapping for the JSP reference implementation. Do this as follows:
#jsp.code=com.sun.jsp.runtime.JspServlet (replacing this with Oracle) jsp.code=oracle.jsp.JspServlet
In a Tomcat environment, mapping each JSP file name extension to the Oracle JspServlet
requires a single step. Update the servlet mapping section of the web.xml
file as shown below.
# Map file name extensions (.sqljsp and .SQLJSP are optional). <servlet-mapping> <servlet-name> oracle.jsp.JspServlet </servlet-name> <url-pattern> *.jsp </url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name> oracle.jsp.JspServlet </servlet-name> <url-pattern> *.JSP </url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name> oracle.jsp.JspServlet </servlet-name> <url-pattern> *.sqljsp </url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name> oracle.jsp.JspServlet </servlet-name> <url-pattern> *.SQLJSP </url-pattern> </servlet-mapping>
You can optionally set an alias for the oracle.jsp.JspServlet
class name, as follows:
<servlet> <servlet-name> ojsp </servlet-name> <servlet-class> oracle.jsp.JspServlet </servlet-class> ... </servlet>
Setting this alias allows you to use "ojsp" instead of the class name for your other settings, as follows:
<servlet-mapping> <servlet-name> ojsp </servlet-name> <url-pattern> *.jsp </url-pattern> </servlet-mapping>
By default, database users are locked when you install the Oracle database. The following special users must be unlocked by the database administrator before you can run servlet, JSP, or EJB applications in the Oracle9i Servlet Engine:
The ALTER USER
command is used for this purpose, as in the following example:
alter user ose$http$admin account unlock;
The OracleJSP front-end servlet, JspServlet
, supports a number of configuration parameters to control OracleJSP operation. They are set as servlet initialization parameters for JspServlet
. How you accomplish this depends on the Web server and servlet environment you are using.
This section describes the OracleJSP configuration parameters and how to set them in the most prevalent Web server and servlet environments.
Only a limited number of these parameters are of interest in the Oracle products that supply OracleJSP, and how to set them may vary from product to product. Consult the product documentation for more information.
Configuration settings that apply to the Oracle9i Servlet Engine are typically supported as equivalent options in the OracleJSP pre-translation tool (ojspc
). OSE does not employ the Oracle JspServlet
in translating or running JSP pages.
This section describes the configuration parameters supported by the Oracle JspServlet
for environments such as Apache/JServ, the Sun Microsystems JSWDK, or Tomcat. (Note that the Oracle9i Application Server uses an Apache/JServ environment.)
For the Oracle9i Servlet Engine environment, some of the equivalent configuration functionality is supported through equivalent ojspc
options.
Table A-2 summarizes the configuration parameters supported by Oracle JspServlet
(the front-end of the OracleJSP container). For each parameter, the table notes the following:
ojspc
translation options for pages that are targeted for the Oracle9i Servlet Engine (which does not use JspServlet
)
OSE does not support execution-time configuration parameters.
Be aware of the following:
debug_mode
and send_error
are supported from OracleJSP release 1.1.2.0 onward.
bypass_source
, emit_debuginfo
, external_resource
, javaccmd
, and sqljcmd
are supported from OracleJSP release 1.1.0.0.0 onward.
alias_translation
is for use in the Apache/JServ environment only.
session_sharing
is for use with globals.jsa
only (presumably in a servlet 2.0 environment such as Apache/JServ).
Notes:
ojspc
options.
Table A-2 OracleJSP Configuration Parameters
This section describes the OracleJSP configuration parameters in more detail.
(boolean; OracleJSP default: false
) (Apache-specific)
This parameter allows OracleJSP to work around limitations in the way Apache/JServ handles directory aliasing. For information about the current limitations, see "Directory Alias Translation".
You must set alias_translation
to true
for httpd.conf
directory aliasing commands, such as the following example, to work properly in the Apache/JServ servlet environment:
Alias /icons/ "/apache/apache139/icons/"
(boolean; OracleJSP default: false
)
Normally, when a JSP page is requested, OracleJSP will throw a FileNotFound
exception if it cannot find the corresponding .jsp
source file, even if it can find the page implementation class. (This is because, by default, OracleJSP checks the page source to see if it has been modified since the page implementation class was generated.)
Set this parameter to true
for OracleJSP to proceed and execute the page implementation class even if it cannot find the page source.
If bypass_source
is enabled, OracleJSP will still check for retranslation if the source is available and is needed. One of the factors in determining whether it is needed is the setting of the developer_mode
parameter.
Notes:
|
(fully qualified path; OracleJSP default: null
)
Use this parameter to add classpath entries to the OracleJSP default classpath for use during translation, compilation, or execution of JSP pages. For information about the OracleJSP classpath and class loader, see "Classpath and Class Loader Issues (Non-OSE Only)".
The exact syntax depends on your Web server environment and operating system. See "OracleJSP Configuration Parameter Settings" for some examples.
Overall, OracleJSP loads classes from its own classpath (including entries from this classpath
parameter), the system classpath, the Web server classpath, the page repository, and predefined locations relative to the root directory of the JSP application.
Be aware that classes loaded through the path specified in the classpath
setting path are loaded by the JSP class loader, not the system class loader. During JSP execution, classes loaded by the JSP class loader cannot access (or be accessed by) classes loaded by the system class loader or any other class loader.
Notes:
|
(boolean; OracleJSP default: true
)
Use the default true
setting of this flag to direct OracleJSP to print a stack trace whenever a runtime exception occurs. Set it to false
to disable this feature.
(boolean; OracleJSP default: true
)
Set this flag to false
to instruct OracleJSP to not routinely compare the timestamp of the page implementation class to the timestamp of the .jsp
source file when a page is requested. With developer_mode=true
, OracleJSP checks every time to see if the source has been modified since the page implementation class was generated. If that is the case, OracleJSP retranslates the page. With developer_mode=false
, OracleJSP will check only upon the initial request for the page or application. For subsequent requests, it will simply re-execute the generated page implementation class.
This flag also affects dynamic class reloading for JavaBeans and other support classes called by a JSP page. With developer_mode=true
, OracleJSP checks to see if such classes have been modified since being loaded by the OracleJSP class loader.
Oracle generally recommends setting developer_mode
to false
, particularly in a deployment environment where code is not likely to change and where performance is a significant issue.
Also see "OracleJSP Runtime Page and Class Reloading (Non-OSE Only)".
(boolean; OracleJSP default: false
) (for developer only)
Set this flag to true to instruct OracleJSP to generate a line map to the original .jsp
file for debugging. Otherwise, lines will be mapped to the generated page implementation class.
Notes:
|
(boolean; OracleJSP default: false
)
Set this flag to true to instruct the OracleJSP translator to place generated static content (the Java print commands that output static HTML code) into a Java resource file instead of into the service method of the generated page implementation class.
The resource file name is based on the JSP page name, with the .res
suffix. With Oracle9i, translation of MyPage.jsp
, for example, would create _MyPage.res
in addition to normal output. The exact implementation may change in future releases, however.
The resource file is placed in the same directory as generated class files.
If there is a lot of static content in a page, this technique will speed translation and may speed execution of the page. In extreme cases, it may even prevent the service method from exceeding the 64K method size limit imposed by the Java VM. For more information, see "Workarounds for Large Static Content in JSP Pages".
Note:
When you are pre-translating pages to run in the Oracle9i Servlet Engine, the
The |
(compiler executable; OracleJSP default: null
)
This parameter is useful in either of the following circumstances:
javac
command-line options (although default settings are typically sufficient)
javac
(optionally including command-line options)
Specifying an alternative compiler results in OracleJSP spawning that executable as a separate process in a separate JVM, instead of spawning the JDK default compiler within the same JVM in which OracleJSP is running. You can fully specify the path for the executable, or specify only the executable and let OracleJSP look for it in the system path.
Following is an example of a javaccmd
setting to enable the javac -verbose
option:
javaccmd=javac -verbose
The exact syntax depends on your servlet environment. See "OracleJSP Configuration Parameter Settings".
Notes:
|
(fully qualified directory path; OracleJSP default: null
)
OracleJSP uses the Web server document repository to generate or load translated JSP pages. By default, in an on-demand translation scenario, the root directory is the Web server doc root directory (for Apache/JServ) or the servlet context root directory of the application the page belongs to. JSP page source is in the root directory or some subdirectory. Generated files are written to a _pages
subdirectory or some corresponding subdirectory.
Set the page_repository_root
option to instruct OracleJSP to use a different root directory.
For information about file locations relative to the root directory and _pages
subdirectory, see "OracleJSP Translator Output File Locations".
Notes:
|
(boolean; OracleJSP default: false
)
Set this flag to true
to direct OracleJSP to output generic "404" messages for file-not-found conditions, and generic "500" messages for compilation errors.
This is as opposed to outputting customized messages that provide more information (such as the name of the file not found). Some environments, such as Apache/JServ, do not allow output of a customized message if a "404" or "500" message is output.
(boolean; OracleJSP default: true
) (for use with globals.jsa)
When a globals.jsa
file is used for an application, presumably in a servlet 2.0 environment, each JSP page uses a distinct JSP session wrapper attached to the single overall servlet session object provided by the servlet container.
In this situation, the default true
setting of the session_sharing
parameter results in JSP session data being propagated to the underlying servlet session. This allows servlets in the application to access the session data of JSP pages in the application.
If session_sharing
is false
(which parallels standard behavior in most JSP implementations), JSP session data is not propagated to the servlet session. As a result, application servlets would not be able to access JSP session data.
This parameter is meaningless if globals.jsa
is not used. For information about globals.jsa
, see "Overview of globals.jsa Functionality".
(SQLJ translator executable and options; OracleJSP default: null
)
This parameter is useful in any of the following circumstances:
(You can set multiple SQLJ options in the sqljcmd
setting.)
Specifying a SQLJ translator executable results in OracleJSP spawning that executable as a separate process in a separate JVM, instead of spawning the default SQLJ translator within the same JVM in which OracleJSP is running.
You can fully specify the path for the executable, or specify only the executable and let OracleJSP look for it in the system path.
Following is an example of a sqljcmd
setting:
sqljcmd=sqlj -user=scott/tiger -ser2class=true
(The exact syntax depends on your servlet environment. See "OracleJSP Configuration Parameter Settings".)
Notes:
|
(boolean; OracleJSP default: false
)
Set this flag to true
to override servlet containers that do not encode multibyte (globalization support) request parameters or bean property settings. With this setting, OracleJSP encodes request parameters and bean property settings. Otherwise, OracleJSP returns the parameters from the servlet container unchanged.
Because the Oracle9i Servlet Engine does not support execution-time configuration parameters, translate_params
cannot be set for the OSE environment. See "Code Equivalent to the translate_params Configuration Parameter" for a workaround.
For more information about the functionality and use of translate_params
, including situations where it should not be used, see "OracleJSP Extended Support for Multibyte Parameter Encoding".
Note:
Beginning with OracleJSP release 1.1.2.x, it is preferable to use the |
(boolean; OracleJSP default: false
) (for developer only)
By default, OracleJSP restarts the application and sessions whenever a JSP page is dynamically retranslated and reloaded (which occurs when the JSP translator finds a .jsp
source file with a more recent timestamp than the corresponding page implementation class).
Set this parameter to true
to instruct OracleJSP not to restart the application after dynamic retranslations and reloads. This avoids having existing sessions become invalid.
For a given JSP page, this parameter has no effect after the initial request for the page if developer_mode
is set to false
(in which case OracleJSP never retranslates after the initial request).
How to set the JSP configuration parameters discussed in the preceding section--"OracleJSP Configuration Parameters (Non-OSE)"--depends on your Web server and servlet environment.
Non-Oracle environments support configuration parameter settings through properties files or similar functionality.
The Oracle9i Servlet Engine, provided with Oracle9i, does not directly support OracleJSP configuration parameters (because it does not use JspServlet
). However, some of the translation parameter settings have equivalent OracleJSP translator options. These options are noted in the "Configuration Parameters Summary Table".
Other Oracle products that support OracleJSP have their own mechanisms for configuration settings--consult the product documentation.
The remainder of this section describes how to set configuration parameters in the Apache/JServ, Sun Microsystems JSWDK, and Tomcat environments.
Each Web application in an Apache/JServ environment has its own properties file, known as a zone properties file. In Apache terminology, a zone is essentially the same as a servlet context.
The name of the zone properties file depends on how you mount the zone. (See the Apache/JServ documentation for information about zones and mounting.)
To set OracleJSP configuration parameters in an Apache/JServ environment, set the JspServlet
initArgs
property in the application zone properties file, as in the following example (which happens to use UNIX syntax):
servlet.oracle.jsp.JspServlet.initArgs=developer_mode=false, sqljcmd=sqlj -user=scott/tiger -ser2class=true,classpath=/mydir/myapp.jar
(This is a single wrap-around line.)
The servlet path, servlet.oracle.jsp.JspServlet
, also depends on how you mount the zone. It does not represent a literal directory path.
Be aware of the following:
initArgs
commands are cumulative and overriding. For example, the combination of the following two commands (in order):
servlet.oracle.jsp.JspServlet.initArgs=foo1=val1,foo2=val2 servlet.oracle.jsp.JspServlet.initArgs=foo1=val3
is equivalent to the following single command:
servlet.oracle.jsp.JspServlet.initArgs=foo1=val3,foo2=val2
In the first two commands, the val3
value overrides the val1
value for foo1
, but does not affect the foo2
setting.
initArgs
parameters are comma-separated, there can be no commas within a parameter setting. Spaces and other special characters (such as "=" in this example) do not cause a problem, however.
To set OracleJSP configuration parameters in a JSWDK environment, set the jsp.initparams
property in the servlet.properties
file in the WEB-INF
directory of the application servlet context, as in the following example (which happens to use UNIX syntax):
jsp.initparams=developer_mode=false,classpath=/mydir/myapp.jar
To set OracleJSP configuration parameters in a Tomcat environment, add init-param
entries in the web.xml
file as shown below.
<servlet> <init-param> <param-name> developer_mode </param-name> <param-value> true </param-value> </init-param> <init-param> <param-name> external_resource </param-name> <param-value> true </param-value> </init-param> <init-param> <param-name> javaccmd </param-name> <param-value> javac -verbose </param-value> </init-param> </servlet>
Because the Oracle9i Servlet Engine does not use the OracleJSP JspServlet
front-end, it requires other mechanisms for OracleJSP configuration settings.
Appropriate translation-time configuration parameters have equivalent support through command-line options of ojspc
, which is the utility to pre-translate JSP pages for the OSE environment. The correlation between OracleJSP configuration parameters and ojspc
options is noted in the table in "Configuration Parameters Summary Table".
There is no such equivalent support for runtime configuration parameters, however. The most significant of these is translate_params
, required for use in supporting globalization in servlet environments that do not support multibyte encoding of request parameters. The Oracle9i Servlet Engine requires this functionality, but it is left to the developer to write equivalent code in the JSP page. For details, see "Code Equivalent to the translate_params Configuration Parameter".
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|