springboot + post Chinese garbled

To check your filter configuration are configured with a highest priority filter, the highest priority filter will affect CharacterEncodingFilter springboot configured automatically. For the following reasons:

  In the tomcat:

  1. parameter request object not start parsing, and so it is the first time you call getParameter*time and other parameters related to the request for obtaining the only resolution

  2. Once paramter is resolved once, it will not be parsed again

  So if CharacterEncodingFilterthere is another filter before, and this filter calls the getParameter*method, then it is possible to resolve using the wrong encoding, resulting in garbled.

Methods: change the priority of your own filter configuration, at least a lower priority than the CharacterEncodingFilter.

Guess you like

Origin www.cnblogs.com/shulipeng/p/11712360.html