1、在JSP页面的头部定义
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> |
2、在JSP页面的java代码部分使用
request.setCharacterEncoding(“UTF-8”); |
3、在Tomcat、server.xml中
<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443" URIEncoding="UTF-8"/> |