IBM Support

Getting the generated Java source for a JSP file

Troubleshooting


Problem

When debugging problems related to JSP files, it is often important to get the generated Java™ source for the JSP. This document describes various techniques in getting the Java source generated for the JSP file.

Resolving The Problem

Depending on where you are in the J2EE Application Life Cycle, you can do this using various methods. In the cases below, the generated Java source for all newly compiled JSP files will be stored in the JSP scratch directory, which by default is the following folder:

Profile_Root/temp/node_name/server_name/EAR_App_Name/WAR_APP_Name/temp

For more information, search for keepgenerated in the appropriate version of the WebSphere Application Server Information Center.

  1. If you are in development phase and using tools like WebSphere Studio Application Developer or Rational Application Developer:
    1. Open the deployment descriptor for the Web Application.

    2. Go to Extensions tab.

    3. Add a new jsp attribute with name="keepgenerated" and value="true".

    4. Save all changes.

  2. If you have already deployed your application and are using JSPBatchCompiler to compile JSPs, then you can specify the keep generated option for the JSP batch compiler:

    JspBatchCompiler -enterpriseapp.name enterprise_app_name -webmodule.name web_module_name -cell.name cell_name -node.name node_name -server.name server_name [-filename jsp_name] -keepgenerated true

  3. If the application is already deployed and you do not want to use the JSP Batch compiler, you can modify the configuration file to do the same as in step 1, above:
    1. Edit the ibm-web-ext.xmi located in WEB-INF file for the installed Web application.
      • Edit file in WebSphere_Home/config folder

      • Do not edit the file in WebSphere_Home/InstalledApps.

    2. Add the line as shown below, indicated by bold and underline, after the webApp element in the same file:

      <webappext:WebAppExtension xmi:version="2.0"
        xmlns:xmi="http://www.omg.org/XMI"
        xmlns:webappext="webappext.xmi"
        xmlns:webapplication="webapplication.xmi"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmi:id="WebAppExtension_1"
        reloadInterval="3"
        reloadingEnabled="true"
        additionalClassPath=""
        fileServingEnabled="true"
        directoryBrowsingEnabled="false"
        serveServletsByClassnameEnabled="true">
      <webApp href="WEB-INF/web.xml#WebApp"/>
      <jspAttributes xmi:id="JSPAttribute_1"
        name="keepgenerated" value="true"/>
      </webappext:WebAppExtension>

[{"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"JSP","Platform":[{"code":"PF002","label":"AIX"}],"Version":"9.0;8.5","Edition":"Base;Network Deployment","Line of Business":{"code":"LOB36","label":"IBM Automation"}},{"Product":{"code":"SSNVBF","label":"Runtimes for Java Technology"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Java SDK","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB36","label":"IBM Automation"}},{"Product":{"code":"SS7JFU","label":"WebSphere Application Server - Express"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"JSP","Platform":[{"code":"PF002","label":"AIX"}],"Version":"","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
15 June 2018

UID

swg21232487