HttpServletResponse reponse = ServletActionContext.getResponse(); reponse.setCharacterEncoding("UTF-8"); // 设置响应的编码 reponse.setContentType("text/html"); PrintWriter out; result = "1"; out = reponse.getWriter(); out.print(result); // 输出检测结果 out.flush(); out.close();