Here is what I do in a similar situation:
<html:link paramId="role" paramName="role"
page='<%="/user/saveUser.do?action=Remove&org.apache.struts.taglib.html.TOKEN="
+
session.getAttribute("org.apache.struts.action.TOKEN")%>'>
Remove Role </html:link>
It's ugly, but it works for now. Notice the single quotes around the page
argument. Very important or the JSP parser will get confused by the
embedded double quotes in the expression.
I've submitted an enhancement request (Bug #874
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=874) to add an optional
parameter to the html:link tag that would do this magic without the need
for the expression shown above. If I can get Struts set up to build
locally, I will probably give implementing this a go myself so I can submit
a patch rather than just a request. Using the link above, you can vote for
the implementation of this enhancement.
Mike
At 07:43 AM 3/7/2001, you wrote:
>Hello,
>
> I have posted this before. This is extremely urgent for me. I know that
>the token support exists for posting Form(s). How can i ensure that this
>same token will be issued to a hyperlink so that i can validate that the
>user will click on the hyperlink only once ? Any help is greatly
>appreciated. Thanks a lot.
>
>cheers,
>Amar..
>
>
>-----Original Message-----
>From: Nanduri, Amarnath [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, March 06, 2001 2:23 PM
>To: '[EMAIL PROTECTED]'
>Subject: token issue in hyperlink
>
>
>
>Hello All ,
>
> I am using the Action class saveToken() method to ensure that a token
>is created and set (so that the user has proper screen flow). My question is
>... how can i add this token to a hyperlink ?
>
> I have a hyperlink in a jsp page, which takes me to a different Action
>class. I am checking for this token in the second Action class. Any help is
>greatly appreciated. Thanks.
>
>cheers,
>Amar..