Meaningless Drivel is fun!*
The moose likes Struts and the fly likes Struts 2 Token interceptor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 Token interceptor" Watch "Struts 2 Token interceptor" New topic

Struts 2 Token interceptor

nir sharma
Ranch Hand

Joined: Sep 11, 2012
Posts: 72

I create a demo project to implement token session to prevent multiple form submission. It worked fine.
But it didn't work when I implemented the same thing in my project.
I have written <s:token/> inside form tag in login.jsp.
In struts:

Rather than showing the login page, it showing the error page directly.
Any suggestions.
nir sharma
Ranch Hand

Joined: Sep 11, 2012
Posts: 72

I'm getting this warning in log file

can anyone help. I'm unable to find any solution related to this over the internet.
jatan bhavsar
Ranch Hand

Joined: Jul 23, 2008
Posts: 296

Hi Nir,

Can you post the whole code or the dummy application where its not working. Try to find out the changes because of which it works in one project and not working in another projectPost some code .
Also,Make sure s your <s:token> tag is inside the form tag.

nir sharma
Ranch Hand

Joined: Sep 11, 2012
Posts: 72

found the problem area, my struts code which was creating problem:

but it should be :

thanks for the help.
I agree. Here's the link:
subject: Struts 2 Token interceptor
Similar Threads
NullPointerException @ validation interceptor
TokenSession Interceptor
Token Interceptor
token Session Interceptor + Struts 2
validations in a tabbedpanel