你可以通过一个中间的jsp页面中转么,直接的实现目前不可能。action是运行在服务器端的,而javascript是运行在客户端的。

解决方案 »

  1.   

    <!--你可以通过一个中间的jsp页面中转么-->不能
      

  2.   

    用一个中转页面来实现!
    这个页面是你的第一个action只要执行你的弹出js的alter框
    通过选择后制定url转向实现你的第2个action!
      

  3.   

    可以让action传给jsp一个标志什么的,让jsp判断这个时候应该去弹出个对话框,
    然后点ok按钮,再将事件提交到后台的下一个action去...
      

  4.   

    绝对可以呀!
    很简单,如下代码:在Action中,例如处理上传文件结束,给用户上传成功的提示;            String strAlert = "文件上传成功!";
                strAlert = new String(strAlert.getBytes("GBK"),"ISO8859-1");
                out.println("<script language=javascript>");
                out.println("alert('" + strAlert + "');");
                out.println("history.go(-2);");//后退两步
               //这里可以放你希望的代码;
                out.println("</script>");
      

  5.   

    如果希望转到其他Action:
               String strAlert = "文件上传成功!";
                strAlert = new String(strAlert.getBytes("GBK"),"ISO8859-1");
                out.println("<script language=javascript>");
                out.println("alert('" + strAlert + "');");
                out.println("self.location.href="127.0.0.1/ddd/do/action");
                out.println("</script>");
      

  6.   

    1.将要显示的javascript脚本写到application.properties里面例如:error.login.name=<Script language='JavaScript'>alert('用户名错误!');</Script>2.在Action中将此错误信息保存到error里面:
        ActionErrors errors = new ActionErrors();
        errors.add(errors.GLOBAL_ERROR,new ActionError("error.login.name",topic.getName()));
        saveErrors(request, errors);
        return mapping.findForward("/forwardpage");3.在forward页面前加上
    <html:errors />解决.
      

  7.   

    application.properties就是ApplicationResource.properties,是你的struts的资源配置文件。
      

  8.   

    实际上一个页面最好只有一个ACTION,至于跳转,完全可实现!
      

  9.   

    在页面上弹出一个modeldialog,在里面做一个jsp页面,然后设置按钮提交的action就可以了