@Override
public String execute() throws Exception {
if ("none".equals(task)) {
HttpServletResponse response = ServletActionContext.getResponse();
response.setContentType("text/html;charset=GBK");
PrintWriter out = response.getWriter();
out.println("<script type=\"text/javascript\">");
out.println("alert(‘响应成功!‘);");
out.println("window.location.href=‘../success.jsp‘");
out.println("</script>");
// action不需要对应结果视图:ajax请求或者servlet方式响应
return NONE;// "none"
}
System.out.println("ImplementAction ");
return SUCCESS;// "success"
}
struts下ajax提交与页面进行提示 返回值为null,布布扣,bubuko.com
时间: 2024-10-07 12:21:32