Was added to the code below, note that the output stream obtained in the obtaining PrintWriter
request.setCharacterEncoding("UTF-8");//对返回浏览器数据没啥用,不过建议添加
respsonse.setHeader("Content-type", "text/html;charset=UTF-8");//告知浏览器编码方式;
response.setCharacterEncoding("UTF-8");
//向前台的页面输出结果的输出流
PrintWriter out=response.getWriter();