用session类型的,如scope="session",在struts的配置文件中改

解决方案 »

  1.   

    具体怎么弄,这样好像不行吧,这个scope是ationform的吧,好像不是action的
      

  2.   

    1.关于用户刷新:
    可以在session中放一个标志变量workingFlag,程序根据这个标志来决定是否忽略用户的刷新。
    String workingFlag= (String)session.getAttribute("workingFlag");
    if (!"working".equals(workingFlag)) {
      session.setAttribute("workingFlag", "working");
      //do action...
      session.setAttribute("workingFlag", "done");
    } else {
      // ignore user operation
    }2.关于终止操作:
    用户通过IE终止操作,没有任何信息(http)通知服务端,所以服务端不可能终止操作。注意这是WEB编程的特点,与windows 编程不同。
    只有在页面上放置一个“终止”按钮,用户点击后,服务端程序才有可能终止操作,这种程序不容易实现,因为服务端的程序是多线程的。
      

  3.   

    jiafcat() ,谢谢,应该可行
      

  4.   

    对了,不知道我如果忽略掉应该返回什么?public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
        /**@todo: complete the business logic here, this is just a skeleton.*/
        String target="failur";
        HttpSession session=(HttpSession)httpServletRequest.getSession();
        try
        {
          ArrayList fileserv=ServConfigList.getInstance().servconfiglist_cla;
          ArrayList lists=getLists(actionForm,fileserv);
          target="success";
          session.setAttribute("fileserv",fileserv);
          session.setAttribute("lists",lists);
          //System.err.println(lists.size());
        }
        catch(Exception ex)
        {
         System.out.println(ex.getMessage());
         target="failur";
        }
         return (actionMapping.findForward(target));
      }
    这个是以前的操作,那如果我忽略以后返回什么呢,返回null么还是返回到原先那个页面
      

  5.   

    if (isTokenValid(request, true)) {
       return mapping.findForward("success");
    } else {
       saveToken(request);
       return mapping.findForward("queryPage");
    }
    可以通过Token来解决重复提交的问题.可以返回到发出请求的页面,你还可以加上ActionError
    给予用户提示
    isTokenValid和saveToken都是Action的方法