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

## OracleJSP Runtime Considerations (Non-OSE Only)

This section describes conditions under which OracleJSP retranslates pages, reloads pages, and reloads classes during runtime. This discussion does not apply to JSP pages running in the Oracle Servlet Engine.

### Dynamic Page Retranslation

As a Web application is running, the OracleJSP container by default will automatically retranslate and reload a JSP page whenever the page source is modified.

OracleJSP checks whether the last-modified time of the page implementation class file, as indicated in the OracleJSP in-memory cache, is older than the last-modified time of the JSP page source file.

You can avoid the overhead of OracleJSP checking timestamps for retranslation by setting the OracleJSP `developer_mode` flag to `false`. This is advantageous in a deployment environment, where source and class files will typically not change. For more information about this flag, see "OracleJSP Configuration Parameters (Non-OSE)". For how to set it, see "OracleJSP Configuration Parameter Settings".

Notes: Because of the usage of in-memory values for the class file last-modified time, note that removing a page implementation class file from the file system will not cause OracleJSP to retranslate the associated JSP page source. OracleJSP will only retranslate when the JSP page source file timestamp changes. The class file will be regenerated when the cache is lost. This happens whenever a request is directed to this page after the server is restarted or after another page in this application has been retranslated.

### Dynamic Page Reloading

The OracleJSP container will automatically reload a JSP page (in other words, reload the generated page implementation class) under the following circumstances.

- the page is retranslated

  (See the previous section, "Dynamic Page Retranslation".)

- a Java class that is called by the page and was loaded by the OracleJSP class loader (and not the system class loader) is modified

  (See the following section, "Dynamic Class Reloading".)

- any page in the same application is reloaded

  A JSP pages is associated with the overall Web application within which it runs (even JSP pages not associated with a particular application are considered to be part of a "default application").

  Whenever a JSP page is reloaded, all JSP pages in the application are reloaded.

  Notes: OracleJSP does not reload a page just because a statically included file has changed. (Statically included files, included through `<%@ include %>` syntax, are included during translation-time.) Page reloading and page retranslation are not the same thing. Reloading does not imply retranslation.

### Dynamic Class Reloading

By default, before OracleJSP dispatches a request that will execute a Java class that was loaded by the OracleJSP class loader, it checks to see if the class file has been modified since it was first loaded. If the class has been modified, then the OracleJSP class loader reloads it.

This applies only to classes in the OracleJSP classpath, which includes the following:

- JAR files in the `WEB-INF/lib` directory

- `.class` files in the `WEB-INF/classes` directory

- classes in paths specified through the OracleJSP `classpath` configuration parameter

- generated `.class` files in the `_pages` output directory

As mentioned in the preceding section, "Dynamic Page Reloading", reloading a class results in the dynamic reloading of JSP pages that reference that class.

Important: Remember that classes must be in the JSP classpath, not the system classpath, to be dynamically reloaded. If they are in the system classpath as well, the system class loader may take precedence in some circumstances, possibly interfering with JSP automatic-reloading functionality. Dynamic class reloading can be expensive in terms of CPU usage. You can disable this feature by setting the OracleJSP `developer_mode` parameter to `false`. This is appropriate in deployment environments where classes are not expected to change.

For information about the `classpath` and `developer_mode` configuration parameters and how to set them, see "OracleJSP Configuration Parameters (Non-OSE)" and "OracleJSP Configuration Parameter Settings".

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