Spring encoding problem

0

Good afternoon, folks,

I'm working on a project with Spring MVC and Spring Security. But the same, is presenting problem in the encoding of the characters, when I do deploy on an external server, ie, I run out of eclipse, someone already step through it and know how to solve? Thank you very much in advance. Thank you.

    
asked by anonymous 14.11.2016 / 17:51

1 answer

0

Opa Roger,

You tried to set the CharacterEncodingFilter filter in your project's web.xml:

<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 setting is important precisely because of the differences in each environment for the charset. Take a look at this link with all the charset settings for Java:

link

    
14.11.2016 / 18:05