你需要保持jsp页面和Servlet类中的编码一致。
jsp页面:
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body></body>
</html>
Servlet类中:
public void doPost(HttpServletRequest request,HttpServletResponse response) throws IOException,ServletException
{
request.setCharacterEncoding("UTF-8") ;
.....
}
温馨提示:答案为网友推荐,仅供参考