cjjspc (pre-compile JSP)

Format

In Windows

cjjspc [-jspworkdir jsp-work-directory-name]
      [-classpath class-path-1[;class-path-2...]]
      [-excludefile jsp-file-path-1[;jsp-file-path-2...]|
      -excludelist compilation-target-exclusion-list-file-path]
      [-keepgenerated]
      [-source {1.3|1.4|1.5|5}]
      [-pageencoding character-encoding]
      [-resultlist execution-results-listings-file-path]
      [-customactiondeclarevariable]
      [-customactionignorecaseattributename]
      [-usebeannocheckclass]
      [-usebeannocheckduplicateid]
      [-tagnocheckrtexprvalue]
      [-tagrtexprvalueterminate]
      [-taglibnocheckprefix]
      [-debugging]
      [-jsppagedisablebom]
      [-nojavaeetaglib]
      [-lowerversion {2.4|2.5}]
      [-addimport <class-name-1>[,<class-name-2>...]]
      -root web-application-root-directory
      [jsp-file-path...]

In UNIX

cjjspc [-jspworkdir jsp-work-directory-name]
      [-classpath class-path-1[:class-path-2...]]
      [-excludefile jsp-file-path-1[:jsp-file-path-2...]|
      -excludelist compilation-target-exclusion-list-file-path]
      [-keepgenerated]
      [-source {1.3|1.4|1.5|5}]
      [-pageencoding character-encoding]
      [-resultlist execution-results-listings-file-path]
      [-customactiondeclarevariable]
      [-customactionignorecaseattributename]
      [-usebeannocheckclass]
      [-usebeannocheckduplicateid]
      [-tagnocheckrtexprvalue]
      [-tagrtexprvalueterminate]
      [-taglibnocheckprefix]
      [-debugging]
      [-jsppagedisablebom]
      [-nojavaeetaglib]
      [-lowerversion {2.4|2.5}]
      [-addimport <class-name-1>[,<class-name-2>...]]
      -root web-application-root-directory
      [jsp-file-path...]

Function

This command generates class files by generating and compiling Java source files from JSP files. The log from execution of this command is output to the standard output or to the standard error output. You can compile all the JSP files included in the Web application.

By specifying the -excludelist or -excludefile option, you can specify JSP files that are to be excluded from compilation. You specify for compilation exclusion files that satisfy any of the conditions listed below (i.e., files that do not require compilation or files that need not be re-compiled):

You cannot specify -excludelist and -excludefile at the same time. If they are both specified, an error message is displayed and processing terminates.

You can also specify the same file in the -resultlist option and the -excludelist option to set the successfully compiled JSP file as the file that is not to be compiled. Also, if an attempt to compile a JSP file has failed and that JSP file is not required to be compiled, you can delete hash mark (#) at the beginning of the path of the JSP file for which an attempt to compile has failed and which is also output to the execution result list file. As a result, the JSP file will not be compiled.

Arguments

-jspworkdir jsp-work-directory-name
Specifies a new work directory name when you wish to change the directory name of the JSP work directory (web-application-root-directory/WEB-INF/cosminexus_jsp_work). You must specify a character string consisting of the alphanumeric characters 0-9, A-Z, or a-z, and the underscore (_). The following directory names cannot be specified (in upper case or lower case):
  • lib
  • tags
  • classes
-classpath class-path
Specifies the absolute path for a class path that is needed for JSP compilation. The default class paths are as follows.
  • web-application-root-directory/WEB-INF/classes
  • JAR file contained in web-application-root-directory/WEB-INF/lib
  • Class library used by the Cosminexus system, containing Servlet 2.5 API, for example
To specify multiple class paths, delimit them with the semicolon (;) in Windows and the colon (:) in UNIX. If the class file in the class library used for the Application Server system and the class file in the jar files included in the class path that is specified in the -classpath option are repeated, the former is given the priority.
-excludefile jsp-file-path
Specifies a JSP file that is to be excluded as a compilation target.
To specify multiple JSP file paths, delimit them with the semicolon (;) in Windows and the colon (:) in UNIX. You specify a JSP file in terms of its relative path from the root directory of the web application. If you include the asterisk wildcard character (*) or a blank, you must enclose the specification in double quotation marks (").
You cannot use the delimiter character (semicolon in Windows, colon in UNIX) in the file path. If you need to include the delimiter character in the file path, you must use a compilation target exclusion list file (specified in the -excludelist option).
The specification methods follow.
Specification method (in Windows)

cjjspc -excludefile jsp-file-path-1;jsp-file-path-2;... -root web-application-root-directory

Specification method (in UNIX)

cjjspc -excludefile jsp-file-path-1:jsp-file-path-2:... -root web-application-root-directory

-excludelist compilation-target-exclusion-list-file-path
Specifies a compilation target exclusion list file that describes JSP files to be excluded from compilation. A compilation target exclusion list file is a text file for describing JSP files that are to be excluded from compilation when JSP pre-compilation is executed using a command.
Specify a relative or absolute path for the file.
The specification method and the file format follow.
Specification method for a compilation target exclusion list file

cjjspc -excludelist compilation-target-exclusion-list-file-path -root web-application-root-directory

File format of a compilation target exclusion list file

# comment
jsp-file-path-1-to-be-excluded-from-compilation
jsp-file-path-2-to-be-excluded-from-compilation
...

-keepgenerated
Specifies that when a JSP file is compiled, the Java source file generated during JSP translation is to be retained. The generated Java source file is created in the same directory as the compiled class file.
The specification method follows.
Specification method

cjjspc -keepgenerated -root web-application-root-directory

-source {1.3|1.4|1.5|5}
Specifies that when a JSP file is compiled, a Java source file is to be generated during JSP translation. You can specify the version of the Java language specification to be used during Java source file compilation. For example, if program codes that depend on the J2SE 1.3 language specifications are described in the JSP file, you would specify 1.3 in this option. If this option is omitted, the Java source file is compiled according to the Java language specifications of the installed JDK.
The specification method follows.
Specification method

cjjspc -source version -root web-application-root-directory

-pageencoding character-encoding
Specifies the default character encoding of a JSP file. The character encoding supported by the JavaVM can be specified as the default character encoding. For details on the character encoding supported by the JavaVM, see the explanation related to the supported encoding in the JDK documentation.
The character strings that you can specify are the character encoding described in the canonical name for the java.nio API and canonical name for the java.lang API and their optional names. If you specify a character encoding that is not supported, an error message is displayed and the process is terminated.
-resultlist execution-results-listings-file-path
Specifies the absolute path or relative path from the current directory for the compilation execution results listings file. The following lists are output to the compilation execution results listings file:
  • JSP file paths that were excluded from compilation
  • JSP file paths that were compiled successfully
  • JSP file paths that could not be compiled
The specification method and the file formats follow.
Specification method

cjjspc -resultlist execution-results-listings-file-path -root web-application-root-directory

Execution results listings file output format

# Excluded JSP files.
compilation-target-exclusion-jsp-file-list
# Compiled JSP files.
jsp-files-that-were-successfully-compiled
# jsp-files-that-could-not-be-compiled
...

If a file with the name that is specified already exists, it is overwritten and processing continues.
-customactiondeclarevariable
Specify this option, when the variable declaration of the script variable corresponding to the second custom tag is to be output in the Java code that is generated from JSP file, when the scope of the script variable name and script variable overlaps in multiple custom tags. If you do not specify this option, the variable declaration of the script variable will not be output.
You can specify the scope of a (*) script variable either in the subclass of the javax.servlet.jsp.tagext.TagExtraInfo class, or in the scope element that exists in the variable element of TLD file.
-customactionignorecaseattributename
Specify this option for confirming whether the attributes specified in the custom tag are defined in the TLD file or in the tag file, and the values are case sensitive.
-usebeannocheckclass
Specify this option when the class attribute value of the <jsp:useBean> tag is not to be verified during the JSP compilation.
-usebeannocheckduplicateid
Specify this option when the id attribute value of the <jsp:useBean> tag is not to be verified during the JSP compilation.
-tagnocheckrtexprvalue
Specify this option, when the specification of Expression is not to be verified in the attribute value of tag in which Expression cannot be specified.
-tagrtexprvalueterminate
Specify this option, when the value enclosed within double quotation marks (") (or single quotation marks (')) is to be treated as a string, when the attribute value of tag begins with "<%=" (or '<%=), but does not end with %>" (or %>').
-taglibnocheckprefix
Specify this option when it is not to be checked whether the custom tag that uses prefix specified in the taglib directive is described before the taglib directive.
-debugging
Specify this option to enable the JSP debug functionality.
When the JSP debug functionality is enabled, SMAP is embedded in the class file of the servlets created from JSP files. Different class names are output when this option is specified or not specified. For details, see 2.4 JSP debug functionality in the uCosminexus Application Server Web Container Functionality Guide.
-jsppagedisablebom
Specify this option when the BOM-based character encoding is not to be determined for the JSP pages of Web applications in Servlet 2.5 and later specifications.
-nojavaeetaglib
Specify this option when the tag libraries included in the Java EE specifications (JSTL and JSF) are not to be automatically mapped in the Web applications of Servlet 2.5 and later specifications. In a Web application conforming to Servlet 2.5 or later specifications, specify the libraries used besides the tag libraries (JSTL, JSF) provided by Application Server.
-lowerversion {2.4|2.5}
You can use the version of the built Web application to compile JSP files.
The specification method is as follows:
Specification method

cjjspc -lowerversion version -root Web-application-root-directory

-addimport class-name-1[,class-name-2...]
Specifies the class names to be imported implicitly (full qualified class name or 'package name.*'). To specify multiple class names, use a ',' (comma) to demarcate the class names. For details on implicit import, see 2.3.7 Implicitly importing the import attribute of the page/tag directive in the uCosminexus Application Server Web Container Functionality Guide.
-root web-application-root-directory
Specifies the web application root directory that contains the JSP to be compiled. Specify either a relative path from the current directory or an absolute path. If the path name contains a space, enclose it in double quotation marks (").
jsp-file-path...
Specifies that compilation is to be executed on the basis of JSP file units. For the JSP file path, specify a relative path from the Web application root directory specified by -root. Use a slash (/) as the path delimiter. You must add a slash (/) at the beginning of the path name. For specifying multiple JSP file paths, delimit them with the single byte space, and then specify. If this option is omitted, all JSP files within the Web application become compilation targets. If a path name includes an asterisk (*) or a space, enclose each JSP file path within double quotation marks (").

Return values

0:
The command terminated normally.
1:
An option analysis error occurred.
2 or greater:
The command terminated abnormally.

Notes