我点一个按钮时弹出一个模态窗体:
function popDialog(){ 
 var url='<%=request.getContextPath()%>/login/changepwd.jsp'; 
 var a = window.showModalDialog(url,'window','center=yes;status=yes;dialogHeight=450px;dialogWidth=600px;resizable=1;'); 
 window.location.reload();
}然后在弹出窗体里输入数据提交给一个action,怎么根据action处理结果弹出处理结果的提示?如果处理成功怎么在给出提示后关闭模态窗体?如果处理失败则给只给出提示。
新手,请知道的朋友给指点下,谢谢了!

解决方案 »

  1.   

    action处理如下:
    @Action(value="changepwd", results = {
    @Result(name = "success", location = "/login/login.jsp", type = "dispatcher"),
    @Result(name = "none", location = "/login/login.jsp", type="dispatcher") })

    public String changeOperPwd() throws IOException{
    HttpServletRequest request = ServletActionContext.getRequest();
    HttpSession session = request.getSession();
    String userId = (String) session.getAttribute("userId");

    int ret = changePwdFacade.changePwd(userId, oldPwd, newPwd);

    if (ret == 0) {
    return SUCCESS;
    } else {
    return NONE;
    }

    }
      

  2.   

    fyjava1984,能给说的详细点吗?不会处理