How to use Token Interceptor
Hi,
Iam a beginner in struts.
I tried to implement Token Interceptor to prevent double submission,
I search internet but didnt find examples to do that in Struts2
I tried below code
<interceptor-ref name="token"/>
<interceptor-ref name="basicStack"/>
<result name="invalid.token">pages/error/error.jsp</result>
<interceptor-ref name="token"/> <interceptor-ref name="basicStack"/> <result name="invalid.token">/error/error.jsp</result>
in action tag of struts.xml
When i click the button first time itself it shows error.jsp
I havent made any changes other than struts.xml to implement Token interceptor
Please correct if iam wrong
Thanks in advance,
View Answers
May 17, 2011 at 5:25 PM
Hi,
Firstly, tag will add in your html form.
Second, Do token entries in struts.xml like this:-
/duplicatformsubmiterror.jsp
/login.jsp
/logsuccess.jsp
Related Tutorials/Questions & Answers:
How to use Token Interceptor - StrutsHow to
use Token Interceptor Hi,
Iam a beginner in struts.
I tried to implement
Token Interceptor to prevent double submission,
I search... error.jsp
I havent made any changes other than struts.xml to implement
Token How to Use Struts 2 token tag - StrutsHow to
Use Struts 2
token tag Hi ,
I want to stop re-submiiting... '
token' tag for it, but not able to find out
how does it works, I' ve put tag....
To solve the re-submission
use a hidden
token in the form. The
token Advertisements
Struts2.2.1 Interceptor ExampleStruts2.2.1
Interceptor Example
In this tutorial, We will discuss about
Interceptor example and
how to
implements
Interceptor In the
Struts...-ref tags.
The following Example will shows
how to implement the
Interceptor