struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Jouravlev (JIRA)" <>
Subject [jira] Commented: (STR-2587) Enhancements for ActionRedirect
Date Wed, 07 Jun 2006 01:39:16 GMT
    [ ] 

Michael Jouravlev commented on STR-2587:

Though I often construct ActionForward objects on the fly myself, I think this is kind of
a hack that should not be used often. Digressing, one of the problems with Struts that it
often has several ways of doing one thing and this does not make things simpler. <forward>
element contains both target location as well as a method to reach it (forwarding or redirecting).
So either one should set redirect="true" in the config file, or use findForward/findRedirect
in the code and have "redirect" attribute removed from XML. Yes, I understand that flexibility
is a great thing, but only when it actually allows to get different results. Here we have
the same result with two slightly different ways, what for?

Could you provide a more compelling reason for this change? The only reason I construct ActionForward
objects dynamically is when I want to pass query parameters in a redirected request.

> Enhancements for ActionRedirect
> -------------------------------
>          Key: STR-2587
>          URL:
>      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:
For more information on JIRA, see:

View raw message