You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "James Holmes (JIRA)" <ji...@apache.org> on 2007/07/23 03:28:05 UTC

[jira] Commented: (WW-1865) Simplify Result Type Annotation by allowing same result types as XML configuration

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

James Holmes commented on WW-1865:
----------------------------------

I can take care of implementing this. We just need to make a decision on how to handle the type field from a backwards compatibility perspective. Here are the options:

1) Leave the "type" field alone and add a "typeName" field.

2) Change the "type" field from Class to String (breaks backwards compatibility).

3) Change the "type" field from Class to Object (should preserve backwards compatibility). The code would do an instanceof check to see what type of object it was and handle accordingly.

Option 3 seems reasonable to me, but I'm somewhat indifferent.

Any one else have an opinion on how this should be implemented?

> Simplify Result Type Annotation by allowing same result types as XML configuration
> ----------------------------------------------------------------------------------
>
>                 Key: WW-1865
>                 URL: https://issues.apache.org/struts/browse/WW-1865
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Configuration
>    Affects Versions: 2.0.6
>            Reporter: Alex  Kira
>            Assignee: James Holmes
>            Priority: Minor
>             Fix For: 2.1.0
>
>
> When using Result annotations, we currently have to use class references to configure the result type.  It would be much simpler and more consistent if we can use the same result types as the XML configuration, such as "redirect-action", "tiles", etc, instead of having to use class names like ServletActionRedirectResult .class and TilesResult.class. 
> So instead of this:
> @Result(name="success", value="main", type=ServletActionRedirectResult .class)
> public class HomeAction extends ActionSupport {
>     // ...
> }
> Be able to do this:
> @Result(name="success", value="main", type="redirect-action")
> public class HomeAction extends ActionSupport {
>     // ...
> }
> or if we are keeping backwards compatiblity, something like this:
> @Result(name="success", value="main", typeName="redirect-action")
> public class HomeAction extends ActionSupport {
>     // ...
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.