JSF 2.0 and Multiple Submission problem

坚强是说给别人听的谎言 提交于 2019-12-03 09:48:48

This is requested and maintained by JSF spec issue 559. As it currently stands, it's not there yet, but it is targeted for the upcoming JSF 2.2.

Until then, the Seam's <s:token> is your best solution which not only prevents CSRF (which is not strictly necessary anymore since JSF 2.1 as per JSF impl issue 812), but also double submits.

<h:commandButton onclick ="setTimeout('document.getElementById(\'' + this.id + '\').disabled=true;', 50);setTimeout('document.getElementById(\'' + this.id + '\').disabled=false;', 500);" />

Thought of improving upon your simple yet elagent solution. I think we should enable the submit button after some time. I'm sure you would have thought of this, but this is for other newbie readers like me :-)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!