Bug ID: 60769
           Summary: Problem with Jsp character encoding configuration
           Product: Tomcat 8
           Version: 8.5.11
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Jasper
  Target Milestone: ----

Created attachment 34775
The two sample applications reproducing the problems

On Tomcat 8.5.11 the attached sample.war, which declares UTF-8 encoding through
a configuration element and Windows-1252 with the XML prolog of the test.jspx
file, does not throw an exception and displays the jspx content. But it works
as expected and throws an exception for the index.jsp, which declares again a
different encoding from the one declared through JSP configuration in web.xml.
I would expect that both the index.jsp and test.jspx from sample.war should
throw an exception, as they do on Tomcat 8.5.5 for example.

Also, if in a jspx file I declare one and the same encoding (in my case
Windows-1252) in both the XML prolog and the page directive pageEncoding
property, I get the error message:
"Page-encoding specified in XML prolog (UTF-8) is different from that specified
in page directive (WINDOWS-1252)", while on Tomcat 8.5.5 I get no error and the
page is displayed. This is in sample1.war, enctext.jspx file.

These behaviors are probably due to change

If the two issues are unrelated I will open another bug report for the second

Reference to relating sections of JSP 2.3 spec:

section 3.3.4 (Declaring page encodings):
"It is also a translation-time error to name different encodings in the prolog
/ text declaration of the document in XML syntax and in a JSP configuration
element matching the document. It is legal to name the same encoding through
multiple mechanisms."

section 4.1.2 (XML Syntax):
"It is a translation-time error to name different encodings in two or more of
the following: the XML prolog / text declaration of a JSP document, the
pageEncoding attribute of the page directive of the JSP document, and in a JSP
configuration element whose URL pattern matches the document."


You are receiving this mail because:
You are the assignee for the bug.
To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to