1

I am using Spring MVC to handle my request and I need to send an String to do a search. I am sending, for example, Caçapava, but somewhere it was converting to this Caçapva, everywhere I was looking for my encoding is set to UTF-8. I am using Jackson to handle my JSON and ExtJs to build my view. My request is ok, so the problem is not with my ExtJs request.

Request parameters:

Query String Parameters

_dc:1363866108143

nomeCidade:Caçapava

page:1

start:0

limit:50

Anyone could help me?

1 Answer 1

2

Basically I use CharacterEncodingFilter to force Spring to use UTF-8 (web.xml):

<filter>
    <filter-name>characterEncodingFilter</filter-name>
    <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
    <init-param>
        <param-name>encoding</param-name>
        <param-value>UTF-8</param-value>
    </init-param>
    <init-param>
        <param-name>forceEncoding</param-name>
        <param-value>true</param-value>
    </init-param>
</filter>

<filter-mapping>
    <filter-name>characterEncodingFilter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

But, it may also depend on your server. Here is the discussion for tomcat. And see here for URIEncoding parameter.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.