Tutorials > Customize > Deploy precompiled JSP files to the WebSphere Commerce Server
Precompile the JSP files
WAS includes a command line utility and an Ant task to...
- Compile all JSP files in an Enterprise Application
- Compile all JSP files in a Web module that is part of an enterprise application
- Compile a single JSP file
This tool can work on an application that is already installed in WAS, or on an EAR file in any directory of the file system. In this task, you'll precompile all of the JSP files for the Stores Web Module. The JSP compiler places a .class file for each JSP under the...
Stores.war/WEB-INF/classesAt run time, the JSP engine uses an algorithm to determine which compiled JSP file to use.
The steps to precompile the JSP files can be done as part of the application build process.
Procedure
- Export the current WebSphere Commerce enterprise application archive.
PROFILE_HOME/bin/wsadmin -c '$AdminApp export WC_instance /mytmp/WC_instance.ear'If you put the enterprise application EAR file in the standard temporary directory, the JSPBatchCompiler reports errors.
- Expand the enterprise application archive.
WAS_HOME/bin/EARExpander -ear /mytmp/WC_instance.ear -operationDir /mytmp/WC_instance.expanded.ear -operation expand -expansionFlags war
- Run the JSP batch compiler.
WAS_HOME/bin/JspBatchCompiler -ear.path /mytmp/WC_jbweb1.expanded.ear -webmodule.name Stores.war -compileToWebInf true
- Since you disabled runtime compilation in Step 3, review the log to ensure that all JSP files compiled without error. If some JSP files are not compiled, correct the error and run the compilation step again.