例如   index.jsp显示所有用户列表   有个action负责删除数据   当action处理完后 执行js脚本  弹出:删除成功 的提示 
后   自动回到index.jsp  请问这个功能该怎么实现 

解决方案 »

  1.   

    好像用window.location = "index.jsp"; 
      

  2.   

    out.print('<javascript>alert('删除成功');window.location = "index.jsp";</javascript>');
      

  3.   

    window.location = "index.jsp" up
      

  4.   

    再action里,request.setAttribute("info","<script>alert('删除成功');</script>");
    然后return "success";再jsp里,<%out.print(request.getAttribute('info'));%>
    或者<s:property value="#request.info" escape="false"/> (注意,这个escape错的话,就用filter,我忘记了。。)
      

  5.   


    可以在你的删除方法中,设置一个标记,用来表示删除结果。
    比如:private boolean isDel = false;
    //set\get方法
    public String del() {
        isDel = xxService.delete(xxobject);
        return SUCCESS;
    }
      跳转控制的话还是配置成跳转到index.jsp即可然后在index.jsp页面添加判断
    <s:if test="isDel ">
      <script type="text/javascript">
         alert("delete success");
      </script>
    </s:if>
      

  6.   

    out.print('<javascript>alert('删除成功');window.location = "index.jsp";</javascript>');