You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Kruse, Matt" <MK...@aquent.com> on 2003/05/13 20:18:20 UTC

RE: RE: Accessing an action directly with req parameter and from a fo rward?

> Thanks for the reply, but unfortunately this does not solve the
> problem.
> Using redirect="true" means that the request attributes set by
> the source attributes to be discarded, so the receiving action
> will not be able to get the data that it needs from the source
> action.

This is a classic problem, and I've found the best solution to be:

1. When going from Save->View for example, use redirect="true"
2. Save messages (like "Account Info Saved") in the session between
redirects
3. Have your "Save" action forward to the "View" action after setting query
parameters

So, "Save" will know the account ID being edited. It saves it (using
something like ParameterActionForward) and then simply goes to the forward.
Your base action picks up the forward, adds the query parameters on the end,
and goes to it.

The user can bookmark the page just fine, can reload just fine, and can see
a logical URL in his browser. Messages are maintained across requests, so
they see a nice confirmation message on the view screen.

Works well for me - I wouldn't do it any other way.

Matt Kruse