Spring encoding problem

Asked

Viewed 319 times

0

Good afternoon Personal,

I’m working on a project with Spring MVC and Spring Security. But the same, is presenting problem in the character encoding, when I deploy on an external server, IE, run outside the eclipse, someone already went through it and know how to solve ? Thanks in advance. Thank you.

1 answer

0


Opa Roger,

You tried to configure the filter CharacterEncodingFilter in the web.xml of your project:

<filter>  
    <filter-name>encodingFilter</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>encodingFilter</filter-name>  
    <url-pattern>/*</url-pattern>  
</filter-mapping> 

This configuration is important precisely because of the differences in each environment for the charset. Also take a look at this link with all charset settings for Java (English):

https://stackoverflow.com/questions/138948/how-to-get-utf-8-working-in-java-webapps

  • Oops, I’ll test it here. Thank you.

  • And then it worked?

  • @dscasto It worked yes friend, thank you very much for the help.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.