2.5.7 Class names in JSP compilation results

This subsection describes the format and the conversion rules of the class names generated from the JSP file or tag file.

Organization of this subsection
(1) Class name format
(2) Class name conversion rules

(1) Class name format

The class name format of the classes generated from JSP files or tag files depend on the file type and whether the JSP debug functionality is enabled. The following table lists the class name formats:

Table 2-14 Class name format of classes generated from JSP files or tag files

File typeWhen the JSP debug functionality is disabledWhen the JSP debug functionality is enabled
JSP filesfile-namefile-name_jsp
Tag filesfile-name_file-name_tag

The rules specified in (2) Class name conversion rules are applied to file-name.


(2) Class name conversion rules

If the name of the class generated from the JSP file or tag file contains characters that cannot be used as class name, underscore (_), or dollar sign ($), the following conversion rules are applied sequentially:

  1. If the first character is the package name and a character that cannot be used at the beginning of the class name, add a dollar sign ($) at the beginning.
  2. Convert a period (.) in the middle of the file name into a dollar sign ($).
  3. For the characters that cannot be used as the class name, convert the underscore (_) and the characters that cannot be used into a string of 4-digit hexadecimal expression.
    The alphabetical characters used in the hexadecimal expression will be in the lower-case.

The conversion rule in step 1 is applied only to the first character. The conversion rules in step 2 and 3 are applied sequentially from the beginning of the string.

The following table describes the conversion examples for names of classes generated from JSP files or tag files:

Table 2-15 Conversion examples for names of classes generated from JSP files or tag files

File typeFile nameJSP debug functionalityClass name
JSP filesindex.jsp--index$jsp
Yindex$jsp_jsp
10test-10.jspx--$10test_002d10$jspx
Y$10test_002d10$jspx_jsp
test.tag--test$tag
Ytest$tag_jsp
Tag filestagfile1.tag--tagfile1$tag_
Ytagfile1$tag_tag
Tag_File$10.tagx--Tag_005fFile_002410$tagx_
YTag_005fFile_002410$tagx_tag
Legend:
Y: Valid
--: Invalid