web.xml中对post请求的乱码问题解决

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

  

posted @ 2017-12-01 15:10  admin_jh  阅读(214)  评论(0编辑  收藏  举报