I am using Struts2 framework, my problem is
If user log-in into system and clicked some action lets say ACTION1
, flow will go to action class and executes some method, return appropriate result.
He may visit some of the web pages, and again clicked ACTION1
.
As long as he is in the same session, now the control should not go that particular method but the result should be same as previous results.
How can we achieve this?
You can try a
tokenSession
interceptor.It will prevent from double submit the same action or reuse the same token that you provide with
s:token
tag.Place the tag inside your form and you never get back in submitting the same form twice. Token session interceptor will try to handle invalid token for you by returning the same response like in first case.