uCosminexus Application Server, Web Container Functionality Guide
According to the JSP specifications, the following classes are imported implicitly while compiling JSP:
If you use the functionality for implicitly importing the import attribute of the page/tag directive, you can implicitly import any desired class besides those described above.
This subsection describes how to specify the functionality for implicitly importing the import attribute of the page/tag directive. You can use the functionality for implicitly importing the import attribute of the page/tag directive when compiling JSP in a J2EE server, or when compiling JSP by the cjjspc command.
Specify the class to be imported implicitly with a fully qualified class name or with the "package name.*". When specifying multiple class names, use a comma (,) to demarcate two class names. When you specify a class name that does not exist or a class name with an invalid class path, the KDJE39143-E message is output during JSP compilation.
The order of the import statements output in the java file during JSP compilation is as follows:
The functionality for implicitly importing the import attribute of the page/tag directive operates during JSP compilation. When JSP pre-compilation is performed by the cjjspc command, the class specified in the webserver.jsp.additional.import.list key of the Easy Setup definition file is not imported implicitly to the Web application for which JSP pre-compilation is performed. Therefore, to perform JSP pre-compilation by the cjjspc command, specify the -addimport option in the cjjspc command and then perform JSP pre-compilation for the Web application, when using the functionality for implicitly importing the import attribute of the page/tag directive.
The class specified in the webserver.jsp.additional.import.list key of the Easy Setup definition file is enabled for all Web applications in the J2EE server for which JSP pre-compilation is not performed by the cjjspc command. If you want to specify a different class for each Web application, specify the -addimport option in the cjjspc command, and then perform JSP pre-compilation for the Web applications.
When all the below conditions are satisfied, the KDJE39143-E message is output during recompilation. Therefore, when using a Web application for which JSP pre-compilation is performed by specifying the -addimport option in the cjjspc command, specify the same class name as the one specified in the -addimport option of the cjjsps command in the webserver.jsp.additional.import.list key of the Easy Setup definition file.
When the class name specified in the functionality for implicitly importing the import attribute of the page/tag directive duplicates a class name within the package to be imported that is specified in the JSP specifications, or the class name specified in the import attribute of the page/tag directive, a compilation error occurs during JSP compilation, and the KDJE39143-E message is output.
An example when a compilation error occurs during JSP compilation is described below. Note that in the example, the following class names must exist as a prerequisite:
An example is described below.
For the following specification contents, when an attempt is made to import classes with the same name from multiple packages, an error occurs during JSP compilation.
Type of file | Specification contents |
---|---|
JSP file | <%@page import="packageA.classA" %> |
Easy Setup definition file | webserver.jsp.additional.import.list=packageB.classA |
An example is described below.
For the following specification contents, whether the classA used in the JSP file is packageA.classA or packageB.classA cannot be identified and an error occurs during JSP compilation.
Type of file | Specification contents |
---|---|
JSP file | <%@page import="packageA.* " %> <% System.out.println(classA.method1()); %> |
Easy Setup definition file | webserver.jsp.additional.import.list=packageB.* |
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.