Configuring JSP engine parameters

Learn about how to add, change or delete JSP engine configuration parameters.

About this task

The following note applies to the file references with a .xmi extension in this topic:
支援的配置 支援的配置: 對於 IBM® 延伸和連結檔而言,.xmi 或 .xml 副檔名取決於您是使用 Java EE 5 之前的應用程式或模組,或 Java™ EE 5 或更新版本的應用程式或模組。 IBM 延伸或連結檔稱為 ibm-*-ext.xmi 或 ibm-*-bnd.xmi,其中 * 是延伸或連結檔的類型,例如:app、application、ejb-jar 或 web。 適用的條件如下:
  • 如果應用程式或模組使用第 5 版之前的 Java EE,副檔名必須是 .xmi。
  • 如果應用程式或模組使用 Java EE 5 或更新的版本,副檔名必須是 .xml。 如果 .xmi 檔是隨附在應用程式或模組,則本產品會忽略 .xmi 檔。

不過,即使應用程式含有 Java EE 5 之前的檔案,且所用的副檔名是 .xmi,其中也可以有 Java EE 5 或更新版本的模組。

ibm-webservices-ext.xmiibm-webservices-bnd.xmiibm-webservicesclient-bnd.xmiibm-webservicesclient-ext.xmiibm-portlet-ext.xmi 檔會繼續使用 .xmi 副檔名。

sptcfg
WebSphere® Application Server does not support the modification of deployment descriptor extension parameters through the Administrative Console or through administrative scripting.
最佳作法 最佳作法: Use an assembly tool, such as Rational Application Developer, to modify IBM extension and binding files. You can convert extension and binding files within modules from XMI to XML using the IBM Bindings and Extensions Conversion Tool for Multi-Platforms.bprac

To add, change or delete JSP engine configuration parameters, complete the following steps:

Procedure

  1. Open the WEB-INF/ibm-web-ext.xmi or WEB-INF/ibm-web-ext.xml file. [AIX Solaris HP-UX Linux Windows][z/OS]

    JSP engine configuration parameters are stored in a web module's configuration directory or in a web modules's binaries directory in the WEB-INF/ibm-web-ext.xmi or WEB-INF/ibm-web-ext.xml file. Open the WEB-INF/ibm-web-ext.xmi or WEB-INF/ibm-web-ext.xml file from:

    [AIX Solaris HP-UX Linux Windows][z/OS]
    • The configuration directory, as in the following example:
      {WAS_ROOT}/profiles/profilename/config/cells/cellname/applications/enterpriseappname/deployments/deployedname/webmodulename
    • The binaries directory if an application was deployed into WebSphere Application Server with the flag Use Binary Configuration set to true. An example of a binaries directory is:
      {WAS_ROOT}/profiles/profilename/installedApps/nodename/EnterpriseAppName/WebModuleName/ 
    [IBM i]

    JSP engine configuration parameters are stored in a web module's configuration directory or in a web modules's binaries directory in the WEB-INF/ibm-web-ext.xmi or WEB-INF/ibm-web-ext.xml file. Open the WEB-INF/ibm-web-ext.xmi or WEB-INF/ibm-web-ext.xml file from:

    [IBM i]
    • The configuration directory, as in the following examples:
      profile_root/config/cells/cellName/applications/enterpriseAppName/deployments/deployedName/webModuleName/WEB-INF/ibm-web-ext.xmi
      profile_root/config/cells/cellName/applications/enterpriseAppName/deployments/deployedName/webModuleName/WEB-INF/ibm-web-ext.xml
    • The binaries directory if an application was deployed into WebSphere Application Server with the flag Use Binary Configuration set to true. Example of a binaries directory is:
      profile_root/installedApps/nodeName/applicationName.ear/applicationName.war/WEB-INF/ibm-web-ext.xmi
      profile_root/installedApps/nodeName/applicationName.ear/applicationName.war/WEB-INF/ibm-web-ext.xml
  2. Edit the WEB-INF/ibm-web-ext.xmi or WEB-INF/ibm-web-ext.xml file.
    • To add configuration parameters to the WEB-INF/ibm-web-ext.xmi file, use the following format:
      xmi:id="JSPAttribute_6" name="parametername" value="parametervalue"/> 
    • To add configuration parameters to the WEB-INF/ibm-web-ext.xml file, use the following format:
      <jsp-attribute name="parametername" value="parametervalue"/>
    • To delete configuration parameters, either delete the line from the file, or enclose the statement with <!-- --> tags.
  3. Save the file.
  4. Restart the Enterprise Application. It is not necessary to restart the server for parameter changes to take effect. However, some JSP engine configuration parameters affect the Java source code that is generated for a JSP. If such a parameter is changed, then you must retranslate the JSP files in the web module to regenerate Java source. You can use the batch compiler to retranslate all JSP files in a web module. The batch compiler uses the JSP engine configuration parameters that you have set in the ibm-web-ext.xmi or ibm-web-ext.xml file, unless you specifically override them. The topic, JSP engine configuration parameters, identifies the parameters that affect the generated Java source.

Example

The following is a sample of the WEB-INF/ibm-web-ext.xmi file. The lines in bold text are JSP engine configuration parameters.
<?xml version="1.0" encoding="UTF-8"?>
<webappext:WebAppExtension xmi:version="2.0" xmlns:xmi=http://www.omg.org/XMI
   xmlns:webappext="webappext.xmi" xmlns:webapplication="webapplication.xmi" xmi:id="WebAppExtension_1"   
   reloadInterval="9" reloadingEnabled="true" defaultErrorPage="error.jsp" additionalClassPath="" 
   fileServingEnabled="true" directoryBrowsingEnabled="false" serveServletsByClassnameEnabled="true" 
   autoRequestEncoding="true" autoResponseEncoding="false">
   <webApp href="WEB-INF/web.xml#WebApp_1"/>
   <jspAttributes xmi:id="JSPAttribute_1" name="useThreadTagPool" value="true"/>
   <jspAttributes xmi:id="JSPAttribute_2" name="verbose" value="false"/>
   <jspAttributes xmi:id="JSPAttribute_3" name="deprecation" value="false"/>
   <jspAttributes xmi:id="JSPAttribute_4" name="reloadEnabled" value="true"/>
   <jspAttributes xmi:id="JSPAttribute_5" name="reloadInterval" value="5"/>
   <jspAttributes xmi:id="JSPAttribute_6" name="keepgenerated" value="true"/>
   <!--<jspAttributes xmi:id="JSPAttribute_7" name="trackDependencies" value="true"/> -->
   
</webappext:WebAppExtension>
The following is a sample of the WEB-INF/ibm-web-ext.xml file. The lines in bold text are JSP engine configuration parameters.
<?xml version="1.0" encoding="UTF-8"?>
<web-ext
   xmlns="http://websphere.ibm.com/xml/ns/javaee"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-web-ext_1_0.xsd"
      version="1.0">

   <default-error-page uri="error.jsp"/>
   <jsp-attribute name="useThreadTagPool" value="true" />
   <jsp-attribute name="verbose" value="false" />
   <jsp-attribute name="deprecation" value="false" />
   <jsp-attribute name="reloadEnabled" value="true" />
   <jsp-attribute name="reloadInterval" value="5" />
   <jsp-attribute name="keepgenerated"  value="true" />
   <jsp-attribute name="trackDependencies" value="true" />
   <reload-interval value="9"/>
   <auto-encode-requests value="true"/>
   <auto-encode-responses value="false"/>
   <enable-directory-browsing value="false"/>
   <enable-file-serving value="false"/>
   <pre-compile-jsps value="false"/>
   <enable-reloading value="true"/>
   <enable-serving-servlets-by-class-name value="true"/>
</web-ext>
Attention: The integer n in JSPattribute_n has to be unique within the file.

指出主題類型的圖示 作業主題



時間戳記圖示 前次更新: July 9, 2016 11:18
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=tweb_jspengine
檔名:tweb_jspengine.html