1、页面编码格式UTF-8
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %> JSP使用
<meta charset="UTF-8">
2、项目、以及文件的编码格式UTF-8
3、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>
4、容器的编码格式。