如何防止Seam中的表单重新提交? [英] How do I prevent form resubmission in Seam?

查看:134
本文介绍了如何防止Seam中的表单重新提交?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的表单,我不想不小心提交多次。

当用户第一次看到页面时,我可以轻松阻止用户进行多次点击,但是我无法控制他们点击后退按钮。



因此,在与Struts合作之后,我决定提交表单提交令牌。 >

有没有更简单的方法?这个功能已经在Seam中了吗?如果没有,我应该如何在Seam中构建这个功能?



//编辑//
这里只是一个说明,我不需要这会使用户免于双击
点击。这已经解决了。

具体使用情况如下:
用户单击按钮。行动运行。将来某些未指定的时间,用户点击后退按钮足够多的时间以返回按钮的页面。用户再次单击该按钮。



如何防止这种情况发生?

解决方案

s:token组件,它就是你要找的:
http://docs.jboss.org/seam/2.2.0.GA/reference/en-US/html/controls.html#d0e28933


I have a simple form that I don't want accidentally submitted multiple times.

I can easily block the user from multiple clicks when they first see the page, but I have no control over them hitting the back button.

So, having worked with Struts, I decided that a form submit token was the way to go.

Is there an easier way? Is this functionality already in Seam? If there isn't, how should I go about building this functionality into Seam?

// EDIT // Just a clarification here, I do NOT need something that will keep the user from double- clicking. That is already solved.

The specific use-case is as follows: The user clicks the button. Action runs. Some unspecified time in the future, the user hits the back button enough times to get back to the page with the button. The user clicks the button again.

How do I protect against that?

解决方案

Seam comes with the s:token component and it is what you are looking for: http://docs.jboss.org/seam/2.2.0.GA/reference/en-US/html/controls.html#d0e28933

这篇关于如何防止Seam中的表单重新提交?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆