On Fri, Jan 30, 2004 at 02:49:43PM -0800, Drew McAuliffe wrote:
> Is there any standard way for dealing with messages that are passed between
> an action and a redirect result? As I understand it, once a redirect is
> done, a new request is created and any messages you may have stored in an
> action (via actionErrors or something hanging off of the action itself) are
> gone.
>  
> The scenario I'm trying to deal with is an administrative password reset
> function. It autogenerates a password, then does a redirect back to the user
> detail page. I want a message to say what the new password is. It works if I
> do it as a chaining result, but that has a problem. On a chain action, after
> a successful change, the URL is still pointing to the reset action. If the
> user hits "refresh", instead of getting a refreshed view page, they'll end
> up calling the action again. For something like this, that could cause
> problems. I usually do a redirect after add and save actions without any
> problem, because I usually never need to display a message. But in this
> case, if I don't display a message, the user won't know what the password
> was reset to! Note that this is only one example, but I can think of a ton
> of other things that a similar pattern would help address.
>  
> I think Struts maintained some sort of information on the session, and that
> may be the only way to handle this, but I wanted to see what others had
> experienced.

Why not redirect to viewpage.action?showpassword=true and the view page
looks up the password from wherever you stored it?

Else you'll have to use the session, or pass the value through to the
redirect.  

Cheers,
Scott


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to