EasyUIJava副帮派至精通——调错篇之EasyUI+SpringMVC Form表单提交至Contorller中文字出现乱码

同、错误现象。

style=”font-size:18px”>EasyUI 1

style=”white-space:pre”>界面Post提交到Contorller的时节以Contorller中冒出乱码。

仲、问题解决。

style=”white-space:pre”>在Web.xml下参加以下代码就足以解决。

style=”white-space:pre”>

   <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>
        <init-param>
            <param-name>forceEncoding</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>characterEncodingFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    <servlet>
        <servlet-name>action</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>/WEB-INF/spring-mvc.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>