sturts返回直接输出action信息

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();

 

你可能感兴趣的:(action)