Java三大框架之struts的防止重复提交

来源:互联网 发布:开一个网络主播工作室 编辑:程序博客网 时间:2024/04/30 21:14

一:使用<s:token/>标签防重复提交

<pre name="code" class="html">加在 form 里;</span></span>使用 token 拦截器:<interceptor-ref name="token"></interceptor-ref><interceptor-ref name="defaultStack"></interceptor-ref><result name="invalid.token">/student.jsp</result> :在 struts.xml 里配置,假如出现重复提交,则直接回到页面;<s:actionerror/>:在页面上显示错误信息;

二:使用 tokenSession 拦截器防重复提交

tokenSesssion 拦截器直接无视重复提交的请求;<interceptor-refname="tokenSession"></interceptor-ref> <interceptor-refname="defaultStack"></interceptor-ref>




0 0