чт, 1 апр. 2021 г. в 00:55, Christopher Schultz <ch...@christopherschultz.net>:
>
> [...]
>
> I've written a tiny JSP to demonstrate the problem.
>
> charecho.jsp
> ==== CUT ====
> <%
>    response.setContentType("text/html");
>    response.setCharacterEncoding("UTF-8");
> %><html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; UTF-8" />

The value above is misspelled. You are missing "charset=" before "UTF-8".
Personally, I usually echo the actual contentType header value when
writing a meta tag. I think that would be
<meta http-equiv="Content-Type" content="<%= response.getContentType() %>">

[...]

>
> So, somewhat "mystery solved" although I'd like to understand why
> <request-character-encoding> didn't work.

Does validating your web.xml file against an xsd schema complete successfully?

request-character-encoding is defined in
(javax|jakarta)/serv/et/resources/web-app_4_0.xsd, which means Tomcat
9 or later. You wrote that you are running Tomcat 8.5.

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to