struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Benedict (JIRA)" <j...@apache.org>
Subject [jira] Commented: (STR-2587) Enhancements for ActionRedirect
Date Mon, 12 Jun 2006 02:52:16 GMT
    [ http://issues.apache.org/struts/browse/STR-2587?page=comments#action_37484 ] 

Paul Benedict commented on STR-2587:
------------------------------------

Good comments, Michael. I've changed my mind on this ticket over time. The reason is because
my need was partially unclear, but now I believe I know what I am looking for:

I constantly come across the use case where I am redirecting at the end of an action. So I
grab a forward, tack on parameters (ActionRedirect), and then return it. My uneasiness with
this approach is that there is no way for me to be assured that the forward I selected is
SUPPOSED to be a redirect. I can wily-nily choose any forward and perhaps erroneously tack
on parameters that makes no sense (like a Struts Tile name).

So I now propose that the purpose of findRedirect is to select the given forward, as before,
except throw an exception if it is not already configured to be a redirect. And because it
is intended as a redirect, it can automatically wrap it in an ActionRedirect, as I proposed
at first.

> Enhancements for ActionRedirect
> -------------------------------
>
>          Key: STR-2587
>          URL: http://issues.apache.org/struts/browse/STR-2587
>      Project: Struts Action 1
>         Type: Improvement

>   Components: Extras
>     Versions: 1.2.7
>  Environment: Operating System: other
> Platform: Other
>     Reporter: Paul Benedict
>     Assignee: Struts Developers
>     Priority: Minor

>
> Now that Struts 1.2.7 supports the ActionRedirect class, I am constantly finding
> myself coding this pattern:
> ActionRedirect redirect = new ActionRedirect(mapping.findForward("name"));
> Something simpler would be:
> ActionRedirect redirect = mapping.findRedirect("name");
> Now someone needs to debate the merit of this approach. Should this find any
> forward and turn it into an ActionRedirect, or only find forwards that have the
> @redirect set to true. I don't know. Let's discuss.
> Also, I like to pass form attributes or request parameters from one request to
> another. How about a shortcut to populate the parameters like:
> redirect.addRequestParameters(request);
> redirect.addFormAttributes(form);

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message