Hi everyone,
anyone knows how to use struts' Token system to avoid duplicated
request/back button with xml and xsl? I know there are something like stxx
but I still want to use the "traditional" struts framework to implement my
project and I try to get the most out of it. I want to use struts to check
duplicated request and check clicking back button. I am using the the
following way to make it work:
displayformActionClass => display displayform.jsp =>
click submit button => processformActionClass => displayformresult.jsp
(saveToken) => put session.getAttribute
=> => call isTokenValid(). =>
(Action.TRANSACTION_TOKEN_KEY)
if !errors.empty()
into the hidden variable of the form
call saveToken()
by putting xml tag into the from in
xsl. else resetToken()
see the detail below
I need to use session.getAttribute(Action.TRANSACTION_TOKEN_KEY) because
I cannot put the struts tag into xsl file and so I cannot use
<html:html><html:form></html:form></html:html> in the file displayform.jsp.
And so I do not know the struts framework is working correctly or not.
This is the generated hidden variable after showing displayform.jsp:
<input type="hidden" name="org.apache.struts.taglib.html.TOKEN"
value="74884694861f57bea8b3225a6777ccfc">
Anyone can help? I am very appreciated if anyone can show the codes how
they make it work. I've already spent a lot of time to investiage....
Thank you
Jason