There may be many ways to solve encoding problem:
Encoding filter like Spring MVC UTF-8 Encoding
Setting URIEncoding=UTF-8 in server.xml of Tom
CharacterEncodingFilter
configures encoding of request body. That is, it affects encoding of POST
request parameters, etc, but doesn't affect encoding of GET
parameters
URIEncoding
is used to specify encoding of the URI, therefore it affects GET
parameters
useBodyEncodingForURI="true"
tells Tomcat to use encoding configured for request body when decoding URIs. So, as far as I understand, if you set CharacterEncodingFilter
and useBodyEncodingForURI="true"
then you don't need URIEncoding
.
In practice, you need to two things to solve possible problems with encoding of parameters:
CharacterEncodingFilter
for POST
requests
URIEncoding
(or useBodyEncodingForURI="true"
) for GET
requests