Network Deployment (Distributed operating systems), v8.0 > Reference > Command-line utilities


JSPBatchCompiler


Overview

The batch compiler...

Running enables faster responses to initial client requests for the JSP files on the web server.

The batch compiler can be executed against...

When the target is a deployed enterprise application, the server does not need to be running to execute the batch compiler. If the batch compiler is executed while the target sever is running, the server is not aware of an updated class file and does not load that class file unless the enterprise application is restarted.


Process of web modules

The batch compiler operates on one web module at a time. If the target is either an EAR file or an installed enterprise application that contains more than one web module, the batch compiler operates on each web module individually. This is done because JSP pages are configured on a web module basis, through the web module's web.xml deployment descriptor file. Within a web module, the batch compiler processes one directory at a time. It validates and translates each JSP page individually, and then invokes the Java compiler for the entire group of generated Java sources files in that directory. If one JSP page fails during the Java compilation phase, the Java compiler might not create class files for most or all of the JSP pages that successfully compiled in that directory.


JSP file extensions

The batch compiler uses four things to determine what file extensions it should process:

  1. Standard JSP file extensions

    • *.jsp
    • *.jspx
    • *.jsw
    • *.jsv

  2. The url-pattern property of the jsp-property-group elements in the deployment descriptor file in Servlet 2.4 web modules

  3. The jsp.file.extensions JSP engine configuration parameter (for pre-Servlet 2.4 web modules)

  4. The batch compiler configuration parameter jsp.file.extensions

The standard extensions are always used by the batch compiler. If the web module contains a Servlet 2.4 deployment descriptor, the batch compiler also processes any url-patterns found within the jsp-config element. If the batch compiler target contains the JSP engine configuration parameter jsp.file.extensions, then those extensions are also processed. If the batch compiler configuration parameter jsp.file.extensions is present, the extensions given are also processed and will override the JSP engine configuration parameter jsp.file.extensions.

It is a good idea to give JSP 'fragments' an extension that is not processed by the batch compiler. Statically-included fragments that do not stand alone generate translation or compilation errors if processed. The JSP 2.0 Specification suggests that you use the extension .jspf for such files.


Batch compiler command

Both a Windows batch file, JspBatchCompiler.bat and UNIX shell script JspBatchCompiler.sh for running the batch compiler from the command line are found in the cd

The batch compiler target is the only required parameter. The target is one of -ear.path, -war.path or -enterpriseapp.name.

cd WAS_HOME/bin
./JspBatchCompiler.sh -ear.path | -war.path | -enterpriseapp.name name
                     [-response.file filename]
                     [-webmodule.name d]
                     [-filename jsp name | directory name
                     [-recurse true | false]
                     [-config.root path]
                     [-cell.name name]
                     [-node.name name]
                     [-server.name name]
                     [-profileName name]
                     [-extractToDir path]
                     [-compileToDir d]
                     [-compileToWebInf true | false]
                     [-compileToWebInf true | false]
                     [-compileAfterFailure true | false]
                     [-translate true | false]
                     [-compile true | false]
                     [-removeTempDir true | false]
                     [-forceCompilation true | false]
                     [-useFullPackageNames true | false]
                     [-trackDependencies true | false]
                     [-createDebugClassfiles true | false]
                     [-keepgenerated true | false]
                     [-keepGeneratedclassfiles true | false]
                     [-usePageTagPool true | false]
                     [-useThreadTagPool true | false]
                     [-classloader.parentFirst true | false]
                     [-classloader.singleWarClassloader true | false]
                     [-additional.classpath /path/to/additional/JAR/files]
                     [-verbose true | false]
                     [-deprecation true | false]
                     [-javaEncoding encoding
                     [-jdkSourceLevel 13 | 14 | 15 | 16]
                     [-compilerOptions space_separated_list_of_java_compiler_options]
                     [-useJikes true | false]
                     [-jsp.file.extensions file extensions to process]
                     [-log.level SEVERE | WARNING | INFO | CONFIG | FINE | FINER | FINEST | OFF]

For more info, see:

For information about the WebSphere Ant task JspC...

The batch compiler is aware of three groups of configuration parameters:

  1. JSP engine configuration parameters for a web module.

    Refer to the JSP engine configuration parameters topic.

  2. Batch compiler response file configuration parameters.

    These are the parameters that are found in a batch compiler response file. See -response.file, below.

  3. Batch compiler command line configuration parameters.

    These are the parameters entered on the command line when running the batch compiler.

The batch compiler looks at all three groups of configuration parameters in order to determine which value for a parameter is used when compiling JSP pages. When resolving the value for a given parameter, the precedence is:

  1. If the parameter is found on the command line, its value is used.

  2. If the parameter is not found on the command line, the batch compiler looks for the parameter in a response file named on the command line.

  3. If no response file is named, or if the parameter is not found therein, the batch compiler looks for the parameter in the web module's JSP engine configuration parameters.

If a configuration parameter is not found among these three groups, then a default value is used. The default values for the configuration parameters are given below along with the description of the parameters.

With one exception, these parameters are not case sensitive; -profileName is case sensitive. If the values specified for these arguments are comprised of two or more words separated by spaces, add quotation marks around the values.

The batch compiler does not create, or set the values of, equivalent JSP engine parameters. This means that if a JSP page in a deployed Web module is modified and is recompiled by the JSP engine at run time, the JSP engine's configuration parameters will determine the engine's behavior. For example, if you use the batch compiler to compile a web module and you use the -useFullPackageNames true option, the JSP files will be compiled to support that option. But the JSP engine parameter useFullPackageNames must also be set to true in order for the JSP runtime to be able to load the compiled JSP pages. If JSP pages are modified in a deployed web module, then the engine's parameters should be set to the same values used in batch compilation.

To use the JSP batch compiler, enter one of the following commands on a single line at an operating system command prompt.:

JSP Configure JSP engine parameters


Related

Batch compiler ant task
Web applications: Resources for learning JSP engine configuration parameters

+

Search Tips   |   Advanced Search