This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes saveToken in forward action Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "saveToken in forward action" Watch "saveToken in forward action" New topic
Author

saveToken in forward action

James Quinton
Ranch Hand

Joined: Oct 02, 2006
Posts: 94
ForwardAction provides a simple approach if you just want a link being forwarded to a jsp page without actually writing an Action class. But how can you saveToken on that jsp since you don't have coding anymore?
Does struts action-mapping tag provides this feature? I don't see it.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
I'm afraid ForwardAction doesn't do anything with tokens. You'll have to write an Action class if you want to use the saveToken method.


Merrill
Consultant, Sima Solutions
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
You could easily write one action class that called saveToken and then returned "findForward("success")" (or whatever you wanted to do). You could then have multiple action mappings that used this same implementation.

- Brent
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: saveToken in forward action
 
Similar Threads
Struts: Duplicate Form Submission Handling
Form Tokens
Stop multiple posts
Need Solution for accesing Action servlet only on Submit
Handling Multiple Submits