ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzamy_5.4.0.1/50/program/jspdisable.htm

91 lines
6.0 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<LINK rel="stylesheet" type="text/css" href="../../../rzahg/ic.css">
<title>Disable JSP run-time compilation</title>
</head>
<BODY>
<!-- Java sync-link -->
<SCRIPT LANGUAGE="Javascript" SRC="../../../rzahg/synch.js" TYPE="text/javascript"></SCRIPT>
<h4><a name="jspdisable"></a>Disable JSP run-time compilation</h4>
<p>The JSP engine translates a requested JSP file, compiles the .java file, and loads the compiled servlet into the run-time environment. In previous versions of WebSphere Application Server - Express, if a .class file did not exist, the JSP engine always translated and compiled the JSP file. You had to turn off the reload capability of Web applications to prevent additional translations and recompiles of the file.</p>
<p>In WebSphere Application Server - Express V5.0.1, you can change the default behavior of the JSP engine by indicating that a JSP file should never be translated or compiled at run time, even when a .class file does not exist.</p>
<p>If run-time compilation is disabled, you must precompile the JSP files, which provides the following advantages:</p>
<ul>
<li>Reduces compilation related disk operations.</li>
<li>Minimizes disk storage requirements necessary for handling temporary .java and .class files generated during a run-time compilation.</li>
<li>Forces the verification that a JSP file compiled successfully before deploying and installing the application in WebSphere Application Server - Express.</li>
</ul>
<p>You can disable JSP file run-time compilation for all Web applications or for a specific Web application:</p>
<ul>
<li><p><strong>Disable compilation for all Web applications</strong><br>
To disable the translation and compilation of JSP files for all Web applications, set the Web container Custom property disableJspRuntimeCompilation to true.</p>
<p>To set this property, perform the following steps:</p>
<ol>
<li><a href="../admin/acstart.htm">Start the WebSphere administrative console</a>.</li>
<li>In the topology tree, expand <strong>Servers</strong>.</li>
<li>Expand <strong>Application Servers</strong>, and click <strong>Application Servers</strong>.</li>
<li>Click your application server.</li>
<li>Click <strong>Web Container</strong>.</li>
<li>Click <strong>Custom Properties</strong>, and select <strong>New</strong>.</li>
<li>In the <strong>Name</strong> field, specify <strong>disableJspRuntimeCompilation</strong>. In the <strong>Value</strong> field, specify <strong>true</strong>.</li>
<li>Save the configuration.</li>
<li>Stop and start the application server for the changes to take effect.</li>
</ol>
<p>Valid values for this setting are true or false. If this property is set to true, then translation and compilation of the JSP files is disabled at run time for all Web applications.</p>
</li>
<li><p><strong>Disable compilation for a specific Web application</strong><br>
To disable the translation and compilation of JSP files for a specific Web application, set the JSP engine initialization parameter disableJspRuntimeCompilation to true. When this setting is enabled, it determines the run-time behavior of the JSP engine and overrides the Web container custom property setting.</p>
<p>To set this parameter, you have to manually add the JSP attributes to the ibm-web-ext.xml file in the Web module of your application. Use WebSphere Development Studio Client for iSeries to import your application and configure JSP attributes. (WebSphere Application Server - Express for iSeries ships with WebSphere Development Studio Client for iSeries.) For example:</p>
<pre>
&lt;jspAttributes xmi:id=&quot;JSPAttribute_1&quot; name=&quot;disableJspRuntimeCompilation&quot; value=&quot;true&quot;/&gt;
</pre>
<p>Export the modified application out of WebSphere Development Studio Client for iSeries as an enterprise archive (EAR) file, and install the EAR file into WebSphere Application Server - Express.</p>
<p>Valid values for this setting are true or false. If this parameter is set to true, translation and compilation of the JSP files is disabled at run time, and the JSP engine only loads precompiled files for the specific Web application.</p>
</li>
</ul>
<p><strong>Implications of disabling JSP run-time compilation</strong></p>
<p>If the Web container custom property or the JSP attribute assembly parameter is not set, the first request for a JSP file results in the translation and compilation of the JSP file when the .class file does not exist. Subsequent requests for the file also result in compilations and translations, but only if the following conditions are met:</p>
<ul>
<li>Compilations and translations are required.</li>
<li>Reloading is enabled for the Web module.</li>
<li>Reload interval is exceeded.</li>
</ul>
<p>If you disable run-time compilation and a request arrives for a JSP file that does not have a matching .class file, the JSP engine returns HTTP error 501 (Not implemented) to the browser. If the JSP file does not exist, the JSP engine returns HTTP error 404 (File not found) to the browser. In both cases, an exception is written to the System Out (SYSOUT) and First Failure Data Capture (FFDC) logs. If a JSP file has a matching .class file but that file is out of date, the JSP engine still loads the .class file into memory.</p>
<p>Perform the following steps to determine whether the disableJspRuntimeCompilation option is enabled in WebSphere Application Server - Express:</p>
<ol>
<li>Enable the Diagnostic Trace Service and set the trace specification to com.ibm.ws.webcontainer.jsp.servlet.*=all=enabled.</li>
<li>Request a JSP file.</li>
<li>Locate the string, disableJspRuntimeCompilation:true, in the trace.log file.</li>
<li>Ensure the jspUri: entry matches the requested JSP file.</li>
</ol>
<p>If both the disableJspRuntimeCompilation:true string and the matching jspUri: entry appear in the trace, the disableJspRuntimeCompilation setting is enabled for the Web application.</p>
</body>
</html>