使用struts2来防止表单重复提交
2011-05-06 13:13
477 查看
步骤:
1)action配置拦截器
2)在form 中放一个<s:token/>标签。可以放在html的<form>中,也可以struts标签的<s:form>中,都一样啦
struts action的xml文件:
...
...
XML code
<action name="save" class="yourAction" method="savepost">
<interceptor-ref name="token"/>
<interceptor-ref name="defaultStack"/>
<result name="invalid.token" >/error/yourError.jsp</result>
<result name="success" >/success.jsp</result>
</action>
...
...
参考地址:http://topic.csdn.net/u/20100728/15/c62d97e3-40e1-4951-a8b3-2640f3677aa9.html
1)action配置拦截器
2)在form 中放一个<s:token/>标签。可以放在html的<form>中,也可以struts标签的<s:form>中,都一样啦
struts action的xml文件:
...
...
XML code
<action name="save" class="yourAction" method="savepost">
<interceptor-ref name="token"/>
<interceptor-ref name="defaultStack"/>
<result name="invalid.token" >/error/yourError.jsp</result>
<result name="success" >/success.jsp</result>
</action>
...
...
参考地址:http://topic.csdn.net/u/20100728/15/c62d97e3-40e1-4951-a8b3-2640f3677aa9.html
相关文章推荐
- 使用struts2的token机制和cookie来防止表单重复提交
- 使用Struts2的token机制和Cookie来防止表单重复提交
- Struts2中使用<s:token>防止表单重复提交
- 使用struts2的token机制和cookie来防止表单重复提交
- 防止表单重复提交(拦截器)一些struts2标签的使用
- 使用struts2的token机制和cookie来防止表单重复提交
- struts2中t使用token防止重复提交表单
- 使用struts2拦截器实现防止表单数据重复提交
- struts2-21使用标签防止表单重复提交
- 使用Struts2防止表单重复提交
- JavaWeb学习总结(十三)——使用Session防止表单重复提交
- session的使用:防止表单重复提交
- Struts2用token防止表单数据重复提交
- JavaWeb学习总结(十三)——使用Session防止表单重复提交
- JavaWeb ——使用Session防止表单重复提交
- struts2之防止表单重复提交
- JSP使用自定义标签防止表单重复提交的方法
- Java Web学习总结(12)——使用Session防止表单重复提交
- Struts2防止表单重复提交
- 1111struts2防止表单重复提交