Hi all I’ve got some jsp pages and im using struts2 to handle my forms.
After submitting a form by user, the url shown in address bar becomes somthing.action, so when the user refreshes the page, the forms gets submitted again. How can I handle this? after submission of a form.
Hi all I’ve got some jsp pages and im using struts2 to handle my
Share
If the goal is to prevent duplicate submission of forms then use
tokeninterceptor http://struts.apache.org/2.x/docs/token-interceptor.html ortokenSessioninterceptor http://struts.apache.org/2.x/docs/token-session-interceptor.html.If you simple want to refresh the page after submit without submitting again then redirect to action where you only show results not form. Use
redirectActionresult for that.