Oracle JavaServer Pages Developer's Guide and Reference Release 8.1.7 Part Number A83726-01 |
Library | Service | Contents | Index

## OracleJSP Execution Models

As mentioned earlier, you can use the OracleJSP framework in a variety of server environments. OracleJSP offers two distinct execution models:

- In environments other than the Oracle Servlet Engine, the OracleJSP container typically translates pages on demand before triggering their execution, as is also true with most other vendors' JSP implementations.

- In the Oracle Servlet Engine environment--for JSP pages running in the Oracle8i database--the developer translates the pages in advance and loads them into the Oracle8i database as working servlets. (Command-line tools are available to translate the pages, load them, and "publish" them to make them available for execution. You can have the translation occur either on the client or in the server.) When the end-user requests the JSP page, it is executed directly, with no translation necessary.

### On-Demand Translation Model

OracleJSP uses the typical on-demand translation model for all server environments that support OracleJSP, other than the Oracle Servlet Engine. This includes using OracleJSP with the Apache Web server with JServ, for example, as well as various Oracle environments.

When a JSP page is requested from a Web server that incorporates the OracleJSP container, the servlet `oracle.jsp.JspServlet` is instantiated and invoked (assuming proper Web server configuration). This servlet can be thought of as the front-end of the OracleJSP container.

`JspServlet` locates the JSP page, translates and compiles it if necessary (if the page implementation class does not exist or has an earlier timestamp than the JSP page source), and triggers its execution.

Note that the Web server must be properly configured to map the `*.jsp` file name extension (in a URL) to `JspServlet`. The steps to accomplish this for Apache/JServ, the Sun Microsystems JWSDK, and Tomcat are discussed in detail in "Configuration of Web Server and Servlet Environment to Run OracleJSP".

### Oracle Servlet Engine Pre-Translation Model

JSP pages intended to run in the Oracle Servlet Engine (OSE), the Web server and servlet container within Oracle8i, are pre-translated and deployed into Oracle8i as working servlets. OSE incorporates the OracleJSP runtime.

#### Deployment Steps to Run JSP Pages in the Oracle Servlet Engine

Perform the following steps to deploy JSP pages into the Oracle8i database:

1. Pre-translate the JSP pages (typically including compilation). The page implementation classes produced by the JSP translator are essentially working servlets.

2. Load the translated JSP pages into the Oracle8i database.

3. Optionally "hotload" the generated page implementation classes.

4. "Publish" the JSP pages to make them accessible from the database for execution.

Command-line tools are available to translate, load, and publish the pages. The translator creates the page implementation class in a `.java` file and compiles it into a `.class` file.

Hotloading can be enabled and accomplished through additional steps. This is a feature that allows more efficient use of literal strings such as the generated HTML tags in a page implementation class.

Deployment to Oracle8i can be performed with the translation being done either in the server or on the client. For more information about these scenarios and the steps involved, see "Deployment to Oracle8i with Server-Side Translation" and "Deployment to Oracle8i with Client-Side Translation".

#### Oracle Servlet Engine JSP Container

The Oracle Servlet Engine incorporates its own OracleJSP container, which consists of most of the overall OracleJSP container without the OracleJSP translator (because any JSP page that runs in the OSE environment is pre-translated).

The OSE includes front-end JSP processing, with functionality similar to `JspServlet` in the on-demand translation model.

The front-end component finds and executes JSP pages according to a servlet path (often referred to as a "virtual path") that was entered in the Oracle8i JNDI name space during publishing. You specify a servlet path name when you publish the JSP page.

| Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
Library | Service | Contents | Index