OracleJSP Support for JavaServer Pages Developer's Guide and Reference
Release 1.1.2.3

Part Number A90208-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to next page

A
General Installation and Configuration

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:

System Requirements

OracleJSP is a pure Java environment. The system on which you install it must meet the following minimum requirements.

operating system:

any OS that supports JDK 1.1.x or higher

Java version:

JDK 1.1.x or 1.2.x (or higher)
(Oracle recommends the most current version available for your platform, preferably JDK 1.1.8 or higher.)

Java compiler:

the standard javac provided with your JDK
(You can, however, use alternative compilers instead.)

Web server:

any Web server that supports servlets

servlet environment:

any servlet container implementing the servlet 2.0 specification or higher


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 javax.servlet.* packages.

For example, in an Apache/JServ environment (including the Oracle9i Application Server), you will need jsdk.jar, which is provided with the Sun Microsystems JSDK 2.0. In a Sun Microsystems JSWDK environment, you will need servlet.jar (servlet 2.1 version), which is provided with JSWDK 1.0. In a Tomcat environment, you will need servlet.jar (servlet 2.2 version), which is provided with Tomcat 3.1. Do not confuse JSDK (Java Servlet Developer's Kit) with JSWDK (JavaServer Web Developer's Kit).

See "Configuration of Web Server and Servlet Environment to Run OracleJSP" for further discussion of classpath settings in a Web server configuration file. 


OracleJSP Installation and Web Server Configuration

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:

Required and Optional Files for OracleJSP

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".)

Summary of Files


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:

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:

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.)

Servlet Library Notes

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).

Table A-1 Servlet Library Versions  
Servlet Library Version  Library File Name  Provided with: 

servlet 2.2 

servlet.jar 

OracleJSP, Tomcat 3.1 

servlet 2.1 

servlet.jar 

Sun JSWDK 1.0 

servlet 2.0 

jsdk.jar 

Sun JSDK 2.0; also used with Apache/JServ 

(For Apache/JServ, download jsdk.jar separately.)

Files for JDBC (optional)

The following files are required if you will use Oracle JDBC for data access. (Be aware that Oracle SQLJ uses Oracle JDBC.)

or:

Files for SQLJ (optional)

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:

(The JDK 1.2.x enterprise edition allows datasource support, in compliance with the SQLJ ISO specification.)

File Installation for Non-Oracle Environments

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.)


Notes:

The Oracle9i Application Server uses an Apache/JServ environment, but you should use application server installation and configuration instructions instead of the Apache/JServ instructions in this appendix. 


Oracle Environments Providing OracleJSP

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".

Configuration of Web Server and Servlet Environment to Run OracleJSP

Configuring your Web server to run OracleJSP pages requires the following general steps:

  1. Add OracleJSP-related JAR and ZIP files to the Web server classpath.

  2. Configure the Web server to map JSP file name extensions (.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.)

Add OracleJSP-Related JAR and ZIP Files to Web Server Classpath

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:

See "Summary of Files" for additional information.


Important:

You must also ensure that OracleJSP can find javac (or an alternative Java compiler, according to your javaccmd configuration parameter setting). For javac in a JDK 1.1.x environment, the JDK classes.zip file must be in the Web server classpath. For javac in a JDK 1.2.x environment, the JDK tools.jar file must be in the Web server classpath. 


Apache/JServ Environment

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


Important:

In an Apache/JServ environment, jsdk.jar must precede servlet.jar in the classpath.  


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

JSWDK Environment

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.


Important:

In a JSWDK environment, the servlet 2.1 version of servlet.jar (provided with Sun JSWDK 1.0) must precede the servlet 2.2 version of servlet.jar (provided with OracleJSP) in your classpath.

The servlet 2.1 version is typically in the jsdkJars environment variable. The overall classpath is formed through a combination of various xxxJars environment variables, including jsdkJars, jspJars, and miscJars. Examine the startserver script to verify that miscJars is added to the classpath after jsdkJars


Tomcat Environment

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.

Map JSP File Name Extensions to Oracle JspServlet

You must configure the Web server to be able to do the following:

Apache/JServ Environment

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.

JSWDK Environment

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

Tomcat Environment

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.


Note:

There is a global web.xml file in the [TOMCAT_HOME]/conf directory. To override any settings in this file for a particular application, update the web.xml file in the WEB-INF directory under the particular application root. 


# 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>

Additional Steps to Run Servlets and JSP Pages in OSE

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;

OracleJSP Configuration

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.

OracleJSP Configuration Parameters (Non-OSE)

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.

Configuration Parameters Summary Table

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:

Be aware of the following:

Configuration Parameter Descriptions

This section describes the OracleJSP configuration parameters in more detail.

alias_translation

(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/"

bypass_source

(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:

  • The bypass_source option is useful in deployment environments that have the generated classes only, not the source. (For related discussion, see "Deployment of Binary Files Only".)

  • Oracle JDeveloper enables bypass_source so that you can translate and run a JSP page before you have saved the JSP source to a file.

 
classpath

(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:

  • OracleJSP runtime automatic class reloading applies only to classes in the OracleJSP classpath. This includes paths specified through this classpath parameter. (See "Dynamic Class Reloading" for information about this feature.)

  • When you pre-translate pages to run in the Oracle9i Servlet Engine, the ojspc -addclasspath option offers some related, though different, functionality. See "Option Descriptions for ojspc".

 
debug_mode

(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.

developer_mode

(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)".

emit_debuginfo

(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:

  • Oracle JDeveloper enables emit_debuginfo.

  • When you are pre-translating pages to run in the Oracle9i Servlet Engine, the ojspc -debug option is equivalent. See "Option Descriptions for ojspc".

 
external_resource

(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 ojspc -extres option is equivalent.

The ojspc -hotload option is also relevant, performing the -extres functionality along with additional steps to allow hotloading into Oracle9i. See "Option Descriptions for ojspc"


javaccmd

(compiler executable; OracleJSP default: null)

This parameter is useful in either of the following circumstances:

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:

  • The specified Java compiler must be installed in the classpath and any front-end utility (if applicable) must be installed in the system path.

  • When you are pre-translating pages to run in the Oracle9i Servlet Engine, the ojspc -noCompile option allows similar functionality. It results in no compilation by javac, so you can compile the translated classes manually using your desired compiler. See "Option Descriptions for ojspc".

 
page_repository_root

(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:

  • The specified directory, _pages subdirectory, and any appropriate subdirectories under these are created automatically if they do not already exist.

  • When you are pre-translating pages to run in the Oracle9i Servlet Engine, the ojspc options -srcdir and -d provide related functionality. See "Option Descriptions for ojspc".

 
send_error

(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.

session_sharing

(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".

sqljcmd

(SQLJ translator executable and options; OracleJSP default: null)

This parameter is useful in any of the following circumstances:

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:

  • Appropriate SQLJ files must be in the classpath, and any front-end utility (such as sqlj in the example) must be in the system path. (For Oracle SQLJ, the translator ZIP or JAR file and the appropriate SQLJ runtime ZIP or JAR file must be in the classpath. See "Summary of Files".)

  • Presumably the great majority of OracleJSP developers will use Oracle SQLJ (as opposed to some other SQLJ product) if they use SQLJ code in their JSP pages; however, this option is useful if you want to use a different Oracle SQLJ version (for example, one intended for use with Oracle JDBC 8.0.x/7.3.x drivers instead of Oracle9i drivers) or if you want to set SQLJ options.

  • When you are pre-translating pages to run in the Oracle9i Servlet Engine, the ojspc -S option provides related functionality. See "Option Descriptions for ojspc".

 
translate_params

(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 PublicUtil.setReqCharacterEncoding() method instead of using the translate_params parameter. See "The setReqCharacterEncoding() Method"


unsafe_reload

(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).


Important:

This parameter is intended for developers only and is not recommended for deployment environments. 


OracleJSP Configuration Parameter Settings

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.

Setting OracleJSP Parameters in Apache/JServ

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:

Setting OracleJSP Parameters in JSWDK

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


Note:

Because initparams parameters are comma-separated, there can be no commas within a parameter setting. Spaces and other special characters do not cause a problem, however. 


Setting OracleJSP Parameters in Tomcat

To set OracleJSP configuration parameters in a Tomcat environment, add init-param entries in the web.xml file as shown below.


Note:

There is a global web.xml file in the [TOMCAT_HOME]/conf directory. To override any settings in this file for a particular application, update the web.xml file in the WEB-INF directory under the particular application root. 


<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>

Oracle9i Servlet Engine JSP Configuration

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".


Go to previous page Go to next page
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback