乱码原因: PrintWriter pw = response.getWriter();获取的流的默认编码是ISO-8859-1 解决方式: 设置编码,是在获取流之前设置 response.setContentType(“text/html;charset=utf-8”);