Page Encoding
For JSP pages, the page encoding is the character encoding in which the file is encoded.
For JSP pages in standard syntax, the page encoding is determined from the following sources:
- The page encoding value of a JSP property group (see Setting Properties for Groups of JSP Pages) whose URL pattern matches the page.
- The
pageEncoding
attribute of thepage
directive of the page. It is a translation-time error to name different encodings in thepageEncoding
attribute of the page directive of a JSP page and in a JSP property group. - The
CHARSET
value of thecontentType
attribute of thepage
directive.
If none of these is provided, ISO-8859-1 is used as the default page encoding.
The pageEncoding
and contentType
attributes determine the page character encoding of only the file that physically
contains the page
directive. A web container raises a
translation-time error if an unsupported page encoding is specified.
Response Encoding
The response encoding is the character encoding of the textual response generated by a web component. The response encoding must be set appropriately so that the characters are rendered correctly for a given locale. A web container sets an initial response encoding for a JSP page from the following sources:
- The
CHARSET
value of thecontentType
attribute of thepage
directive - The encoding specified by the
pageEncoding
attribute of thepage
directive - The page encoding value of a JSP property group whose URL pattern matches the page
If none of these is provided, ISO-8859-1 is used as the default response encoding.