How to reduce the effective size of the JSP compiled class with static content
 Technote (troubleshooting)
 
Problem(Abstract)
If JavaServer Pages™ (JSP™) contain significant amounts of static content, they can fail to compile when the service() method in the resultant Java® file exceeds the Java Virtual Machine(JVM™) limit on the maximum method size of 64 KB.
 
Cause
The Java SDK has a stated limitation on the maximum allowed method size:
http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html
Refer to "4.10 Limitations of Java Virtual Machines."
 
Resolving the problem
Background

In WebSphere® Application Server V4.0, the JSP compiler removes the static content from the generated .java file and places it in a *.dat file. Binary *.dat files are created to store all of the static content (such as, HTML and Javascript) that are not within JSP tags (such as, <% .... %>, <jsp: ..... />, <%@ page .... %> and <%! .... %>). This reduces the size of the service() method in the JSP.

In WebSphere Application Server V5.0 and V6.0 this static content is not removed from the generated .java by default. A JSP attribute called, largefile, needs to be set in order for the compiler to remove static content from the resultant class to a .dat file. This attribute can be set two ways, either by suing AAT/similar tool or editing ibm-web-ext.xmi file.

Using Application Assembly Tool (AAT), WebSphere Studio Application Developer, Application Server Toolkit (ASTK), or a similar tool:

  1. Open the earfile with the tool
  2. Expand ear file -> expand web modules -> expand selected web module
  3. Expand Assembly Property Extensions
  4. Select JSP Attributes and right click to add new attribute.
  5. Specify Name to be largefile and value to be true
  6. Save the changes to archive
  7. Redeploy modified EAR file

Editing ibm-web-ext.xmi file:

  1. Locate ibm-web-ext.xmi file in following directory structure for Application Server 5.0 WAS_HOME\config\cells\<cell-name>\applications\<app-name>\deployments\<app-name>\<web-module>\WEB-INF and following directory structure for WAS 6.0 WAS_HOME\profiles\<profile-name>\config\cells\<cell-name>l\applications\<app-name>\deployments\<app-name>\<web-module>\WEB-INF
  2. Edit ibm-web-ext.xml file to add following line before last line.<jspAttributes xmi:id="JSPAttribute_1117479991684" name="largefile" value="true"/>
  3. Save the file and restart your application in order to make this changes in effect.

Note: Setting this JSP attribute reduces content written to the .class file; however, the 64 KB limit still exists. You may need to take other actions if your resultant .class file still exceeds 64 KB.

 
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > JSP
Operating system(s): iSeries
Software version: 6.0
Software edition:
Reference #: 1164406
IBM Group: Software Group
Modified date: Jan 31, 2007