1. 程式人生 > >解決UTF-8方法歸納

解決UTF-8方法歸納

char ren logs ping utf log Coding ron web

1:通過spring配置過濾器解決

    <!-- 配置Spring提供的字符編碼過濾器 -->
    <filter>
        <filter-name>SpringCharacterEncodingFilter</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>SpringCharacterEncodingFilter</filter-name> <url-pattern>*.do</url-pattern> </
filter-mapping>

解決UTF-8方法歸納