[ 
https://issues.apache.org/struts/browse/WW-1393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39728
 ] 

Don Brown commented on WW-1393:
-------------------------------

Just return a Result object, instead of a String.  The framework will 
automatically detect it and know what to do.

> Returning Result directly
> -------------------------
>
>                 Key: WW-1393
>                 URL: https://issues.apache.org/struts/browse/WW-1393
>             Project: Struts 2
>          Issue Type: New Feature
>            Reporter: Ted Husted
>         Assigned To: Don Brown
>             Fix For: 2.0.2
>
>         Attachments: adrr.txt, rrd1.txt, rrd2.txt, rrd3.txt
>
>
> From: Don Brown <[EMAIL PROTECTED]>   
> Reply-To: Struts Developers List <[email protected]>
> To: Struts Developers List <[email protected]>
> Date: Jul 25, 2006 4:46 PM
> Subject: Returning Result directly (was Re: DefaultActionMapper compatablity 
> switch)
> Tim Fennell wrote:
> > I was going to chime in on this, so I may as well now.  Stripes, through
> > it's default way of routing events, will allow a submitted form or URL
> > to invoke any method that is public no-arg and returns a Resolution -
> > this seems much safer because Resolution is a Stripes specific class as
> > opposed to String, which obviously isn't.  In this case @HandlesEvent is
> > only used to mark methods that have different return types, or need to
> > be aliased.
> I personally would like to see XWork enhanced to support action methods
> returning Result instances directly, however we would have to thoroughly think
> through the consequences.
> Reasons for:
>  - Better security
>  - Easier, more explicit
>  - Results will probably be defined as annotations soon, so why not just 
> return
> the Result directly?
>  - Allows non-annotation apps to drastically minimize config
>  - Supports more complex results
> Reasons against:
>  - The Action interface really loses most of its meaning
>  - ActionSupport could no longer extend Action
>  - XWork internals would need modification since many places expect a result 
> code
>  - Supporting the return of Result, String, and Object might be confusing for
> new developers
>  - Current Results would need some improvements to make them easier to use
> (better constructors, default location names/patterns, etc)
> Again, all things considered, I'd really like to see us add the ability to
> return Results directly as I think it just makes things easier.  The ability 
> to
> separate JSP paths from Java code, IMO, is way overrated and years of its
> practice hasn't shown the additional complexity is really worth it.  For those
> that prefer the old style, they would still have that option.
> Don

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

        

Reply via email to