Precompile JSP files

If you've added the JSP performance enhancements I've discussed in an earlier post. Then I talked about a flag that disabled JSP compilation.

In order to run without compilation enabled you need to precompile your JSP files.

This could be done with the JspBatchCompiler command found in {WAS_ROOT}/bin

This command has multiple parameters but only a few makes sense for Commerce.

  • enterpriseapp.name - The name of your ear application usually WC_{instanceName}
  • webmodule.name - You want to give this parameter Stores.war if you have disabled JSP compilation in your store.
  • compileToWebInf - set this value to false. If you don't the server has to look for your JSP files in the WEB-INF directory instead for the temp directory where the classes usually are compiled.
  • cell.name - Usually WC_{instanceName}_cell in a single node environment.
  • node.name - Usually WC_{instanceName}_node in a single node environment.
  • server.name - Usually server1 in a single node environment.
  • useCDataTrim - set this value to true. This will decrease the size of the delivered code to browsers removing extra line breaks in the compiled classes.
  • forceCompilation - set this value to true if you want all the JSP pages every time. You could set this to false but then you should set the  trackDependencies to true so you don't miss any changes.
  • jdkSourceLevel - I needed this to be 15 to insure that all our customizations where working properly. Might not be needed in your implementation.

An example command string

JspBatchCompiler.bat -enterpriseapp.name WC_demo -webmodule.name Stores.war -compileToWebInf false -cell.name WC_demo_cell -node.name WC_demo_node -server.name server1 -useCDataTrim true -forceCompilation true -jdkSourceLevel 15

A parameter I found after trying that you shouldn't use in a Commerce environment is the useFullPackageNames. This will compile the class files into a separate directory _ibmjsp where the application server will not find your files.After you've compiled your files the application needs a restart to find the newly compiled classes.

Reference: http://pic.dhe.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=%2Fcom.ibm.websphere.express.doc%2Finfo%2Fexp%2Fae%2Frweb_jspbchtl.html

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.