乱码问题

一、乱码问题{
 提交问题{
    post乱码:过滤器解决,在web.xml中配置;

    <!-- 解决post乱码 -->
    <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>


    get乱码:tomcat配置 URIEncoding="utf-8"
 }

 响应乱码{
    response乱码:获取getWriter之前,response.setCharacterEncoding("utf-8");
 }
 
}

二、properties乱码

右键properties文件-------properties选中

posted @ 2019-01-16 08:16  名子  阅读(80)  评论(0)    收藏  举报