spring mvc 解决后台传递值乱码问题

在Web-xml 配置添加过滤器

 

    <!-- 配置过滤器 解决乱码问题 -->

    <filter>

        <filter-name>CharacterEncodingFilter</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>CharacterEncodingFilter</filter-name>

        <url-pattern>/*</url-pattern>

    </filter-mapping>

 

posted @ 2015-01-03 19:23  oftenlin  阅读(211)  评论(0编辑  收藏  举报