-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Léa,

On 1/16/20 4:36 AM, Lmhelp1 wrote:
> Hello,
> 
> Thank you for your answer. Indeed, I have such a filter:
> 
> In "web.xml": 
> ----------------------------------------------------------------------
- ------------------
>
>  <filter> <filter-name>EncodingFilter</filter-name> 
> <filter-class>com.[...].EncodingFilter</filter-class> <init-param> 
> <param-name>requestEncoding</param-name> 
> <param-value>UTF-8</param-value> </init-param> </filter> 
> <filter-mapping> <filter-name>EncodingFilter</filter-name> 
> <url-pattern>/*</url-pattern> </filter-mapping> 
> ----------------------------------------------------------------------
- ------------------
>
> 
> 
> The "doFilter()" method of the "EncodingFilter" class which
> implements "Filter": 
> ----------------------------------------------------------------------
- ------------------
>
>  public void doFilter(ServletRequest  servletRequest, 
> ServletResponse servletResponse, FilterChain     filterChain) 
> throws IOException, ServletException { // Respect the
> client-specified character encoding // (see HTTP specification
> section 3.4.1) if(servletRequest.getCharacterEncoding() == null) { 
> servletRequest.setCharacterEncoding(ms_encoding); }
> 
> // Set the default response content type and encoding 
> servletResponse.setContentType("text/html; charset=" + 
> Finals.S_CHARSET); 
> servletResponse.setCharacterEncoding(Finals.S_CHARSET);
> 
> filterChain.doFilter(servletRequest, servletResponse); }

Nobody should ever use such a filter: it completely clobbers the
response content type and character set, and does so for *every
resource served by the application*.

> Commenting the line: servletResponse.setContentType("text/html;
> charset=" + Finals.S_CHARSET); doesn't solve the problem.

Did you recompile/reinstall?

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl4hJicACgkQHPApP6U8
pFgtwQ//dNP3t7puLUw615yu1sKJFf07cyK3pnJ1BT4t9nMLkMJMNzZwUGkcc/ML
SuSqE9wlB488C6S0RZiIKN9Z4JmFXj1ndF7N374t6ZNcage8YUgSdNwMJ/TdsYLJ
ep42AfscAAcoKJc4sGuPGy/NGwU4VMBRn7N5aVfahodX081gdOaIdJupmHochUwv
qM/LvyJ5KuL6IUp9zOkQHFIWEeCRJeV3NLGa0sKzZD1S9Syx8PAVHaj5Cec2gGX5
lDgztxWqwS7nMeEC7NLLV6PbmnaMWWZvW0dPPpHC+IbHJT3KIlKggY6L6qEt2E1X
XuKeNTuT6attptKAlUY3S7vojzC5iNz3MFjJIzr6B5XoTC9DNlKr/n7haadIekhO
iLOO4faDWInGKhZ4b9w1ZsDBIMxdAyb40igGDmH2QcFaqRK4F0pGVqr7x2jkk9Jm
k7IPqFfzTqW92aJ6bhE4tpCl7msjl8ty5IDuNCqZgMbOgYFvCCUj2WXK10hfiPCj
xsABTL0VIa+FbHMWDlHFjFUVNPqsqn3CvxPY1iAcPWj5u7si2OWFyCXEsIILjUdF
TXTJ73Rd9hSJCt4PpZBqUPzEkLOiMvxj8Z32VzCqN5nHiWNofh0+g5kmu6kP76YH
sOQl+Ak5hdb2zCehcCnFFNCZPEQA9XFqw/wVng+SJ94dmM/rwPU=
=1MqD
-----END PGP SIGNATURE-----

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

Reply via email to