Form禁止重复提交总结

来源:互联网 发布:无法打开淘宝三级页面 编辑:程序博客网 时间:2024/05/13 00:11

1.  页面加token

          <form action="xxx" method="post" onsubmit="return onSubmit()">

                <%=FormToken.hidden(serviceSession.getSession()) %>


2. 后台Servlet加token

        if(!FormToken.verify(serviceSession.getSession(),
                request.getParameter(FormToken.parameterName()))) {
                throw new LogicalException("请不要重复提交请求!");
        }

0 0