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.
In WebSphere Application Server - Express V5.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.
If run-time compilation is disabled, you must precompile the JSP files, which provides the following advantages:
You can disable JSP file run-time compilation for all Web applications or for a specific Web application:
Disable compilation for all Web applications
To disable the translation and compilation of JSP files for all Web applications, set the Web container Custom property disableJspRuntimeCompilation to true.
To set this property, perform the following steps:
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.
Disable compilation for a specific Web application
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.
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:
<jspAttributes xmi:id="JSPAttribute_1" name="disableJspRuntimeCompilation" value="true"/>
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.
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.
Implications of disabling JSP run-time compilation
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:
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. 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.
Perform the following steps to determine whether the disableJspRuntimeCompilation option is enabled in WebSphere Application Server - Express:
If both the disableJspRuntimeCompilation:true string and the matching jspUri: entry appear in the trace, the disableJspRuntimeCompilation setting is enabled for the Web application.