在servlet层,要有
response.setContentType("text/html;charset=UTF-8");
request.setCharacterEncoding("UTF-8");
在jsp层要有
<%@ page language="java" import="com.lxn.manager2.*,java.util.*;" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>显示用户信息</title>
</head>
在数据库层,看my配置设置
[client]
port=3306
[mysql]
default-character-set=utf8