Token Session Interceptor problems

Martin Gilday <[email protected]> Wed, 13 Dec 2006 06:16:00 CST
Newsgroups gmane.comp.java.open-symphony.webwork
Message-ID <284232.1166012191026.JavaMail.os-j2ee@opensymphony01.managed.contegix.com>
I am trying to use token session interceptor to prevent problems with our staff double clicking submit buttons.  I have added it to the default stack:

[code]
<interceptor-ref name="token-session">
  <param name="includeMethods">proceed, etc, etc</param>
</interceptor-ref>
[/code]

I have added tokens to my forms.  I have defined a global invalid token result handler:

[code]
<global-results>
 <result name="exception">/WEB-INF/freemarker/exception.ftl</result>
 <result name="error">/WEB-INF/freemarker/error.ftl</result>
 <result name="invalid.token">/WEB-INF/freemarker/invalid-token.ftl</result>
</global-results>
[/code]

The problems begin when I try double clicking the button.  I check the source and can see the produced token is there.  A single press sends me to the correct page. When I double click (or submit then press back and proceed) I am sent to my global exception page.  This page then moans that there is no exception object.  Checking my server logs I get a few different errors.  Sometimes it is a Jetty EofException being thrown.  But more often it is a null pointer from the ServletRedirectAction:105 (finalLocation = response.encodeRedirectURL(finalLocation);).  I am using redirect-action as my success result so thought that might be an issue so I changed to a normal freemarker result but I still get sent to my exception page.

Things I have tried so far:
1.  Changed to "token" interceptor.  This works prefectly.  On subsequent calls I get correctly sent to the invalid token page defined in my global results.
2.  Changed from using redirect-action result type to standard freemarker page.  Problems persist.
3.  Tried different web servers.  I first had the problem with Jetty6 so I also tried it on JBoss4.

Are there any known problems or limitations with this interceptor?  I have looked through the source and can see no reason it shouldn't work.  A search on the forum suggest that this is an infrequently used interceptor.

Thanks,
Martin.
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=53319&messageID=107211#107211

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]