在web.xml里面配置

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

 

posted on 2018-06-14 09:16  song.yan  阅读(252)  评论(0编辑  收藏  举报