You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Paul Benedict (JIRA)" <ji...@apache.org> on 2006/10/01 03:25:15 UTC

[jira] Created: (STR-2956) Strongly typed forms in Action dispatching

Strongly typed forms in Action dispatching
------------------------------------------

                 Key: STR-2956
                 URL: http://issues.apache.org/struts/browse/STR-2956
             Project: Struts 1
          Issue Type: Improvement
    Affects Versions: 1.0 Final
            Reporter: Paul Benedict
             Fix For: 1.3.6


Actions always cast a form into the intended subclass. It would be nice to allow the the dispatch classes to match up against the strongly typed methods. Example:

private ActionForward doMyActionActionMapping mapping, MyForm form, HttpServletRequest request,
            HttpServletResponse response);


-- 
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

        

[jira] Reopened: (STR-2956) Strongly typed forms in Action dispatching

Posted by "Paul Benedict (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/struts/browse/STR-2956?page=all ]

Paul Benedict reopened STR-2956:
--------------------------------

             

> Strongly typed forms in Action dispatching
> ------------------------------------------
>
>                 Key: STR-2956
>                 URL: http://issues.apache.org/struts/browse/STR-2956
>             Project: Struts 1
>          Issue Type: Improvement
>    Affects Versions: 1.0 Final
>            Reporter: Paul Benedict
>
> Actions always cast a form into the intended subclass. It would be nice to allow the the dispatch classes to match up against the strongly typed methods. Example:
> private ActionForward doMyAction(ActionMapping mapping, MyForm form, HttpServletRequest request, HttpServletResponse response);

-- 
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

        

[jira] Commented: (STR-2956) Strongly typed forms in Action dispatching

Posted by "Paul Benedict (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/struts/browse/STR-2956?page=comments#action_38329 ] 
            
Paul Benedict commented on STR-2956:
------------------------------------

Good points in paragraph one. I don't know if anyone has ever done strongly typed forms in an action method. I never have seen it discussed. It's possible. This is definitely not a solution for DynaBeans.

I agree the complexity would be raised. The reason I find the complexity appealing is because I use non-Dyna forms 99% of the time. The casting could be one line I can remove in about 30 places :-) I got my idea off of Spring because Spring can auto-dect types, and I find that kind of stuff appealing. I personally rather work with strict typing than casting from generics.

> Strongly typed forms in Action dispatching
> ------------------------------------------
>
>                 Key: STR-2956
>                 URL: http://issues.apache.org/struts/browse/STR-2956
>             Project: Struts 1
>          Issue Type: Improvement
>    Affects Versions: 1.0 Final
>            Reporter: Paul Benedict
>             Fix For: 1.3.6
>
>
> Actions always cast a form into the intended subclass. It would be nice to allow the the dispatch classes to match up against the strongly typed methods. Example:
> private ActionForward doMyAction(ActionMapping mapping, MyForm form, HttpServletRequest request, HttpServletResponse response);

-- 
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

        

[jira] Commented: (STR-2956) Strongly typed forms in Action dispatching

Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/struts/browse/STR-2956?page=comments#action_38324 ] 
            
Niall Pemberton commented on STR-2956:
--------------------------------------

I'm not sure I agree that this is a good idea. Seems to me keeping the framework simple is best, especially as the gain in this situation is only saving a one line cast. I could also imagine people then expecting that if the method is defined with a super class that it should also work with sub-classes - which if we tried to handle would get more complicated and if we don't will probably generate questions on the user list asking why their Action's method can't be found.

Also isn't there a potential backwards compatibility issue if people have already used strongly typed methods in their DispatchAction - they will suddenly find these being called directly, rather than the original method using ActionForm? I guess this could be overcome by checking for a method defined using ActionForm first, before looking for strongly typed methods.

I don't use DispatchActions, but if I did I wouldn't find this very helpful since most of my actions cast to a DynaBean - using DynaBean in the method means I'm not tied to an implementation for accessing property values, but also if I want to use any of the ActionForm's convenience methods they're also available through the form parameter passed to the method.

> Strongly typed forms in Action dispatching
> ------------------------------------------
>
>                 Key: STR-2956
>                 URL: http://issues.apache.org/struts/browse/STR-2956
>             Project: Struts 1
>          Issue Type: Improvement
>    Affects Versions: 1.0 Final
>            Reporter: Paul Benedict
>             Fix For: 1.3.6
>
>
> Actions always cast a form into the intended subclass. It would be nice to allow the the dispatch classes to match up against the strongly typed methods. Example:
> private ActionForward doMyAction(ActionMapping mapping, MyForm form, HttpServletRequest request, HttpServletResponse response);

-- 
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

        

[jira] Resolved: (STR-2956) Strongly typed forms in Action dispatching

Posted by "Paul Benedict (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/struts/browse/STR-2956?page=all ]

Paul Benedict resolved STR-2956.
--------------------------------

    Resolution: Won't Fix

> Strongly typed forms in Action dispatching
> ------------------------------------------
>
>                 Key: STR-2956
>                 URL: http://issues.apache.org/struts/browse/STR-2956
>             Project: Struts 1
>          Issue Type: Improvement
>    Affects Versions: 1.0 Final
>            Reporter: Paul Benedict
>
> Actions always cast a form into the intended subclass. It would be nice to allow the the dispatch classes to match up against the strongly typed methods. Example:
> private ActionForward doMyAction(ActionMapping mapping, MyForm form, HttpServletRequest request, HttpServletResponse response);

-- 
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

        

[jira] Updated: (STR-2956) Strongly typed forms in Action dispatching

Posted by "Paul Benedict (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/struts/browse/STR-2956?page=all ]

Paul Benedict updated STR-2956:
-------------------------------

    Description: 
Actions always cast a form into the intended subclass. It would be nice to allow the the dispatch classes to match up against the strongly typed methods. Example:

private ActionForward doMyAction(ActionMapping mapping, MyForm form, HttpServletRequest request, HttpServletResponse response);


  was:
Actions always cast a form into the intended subclass. It would be nice to allow the the dispatch classes to match up against the strongly typed methods. Example:

private ActionForward doMyActionActionMapping mapping, MyForm form, HttpServletRequest request,
            HttpServletResponse response);



> Strongly typed forms in Action dispatching
> ------------------------------------------
>
>                 Key: STR-2956
>                 URL: http://issues.apache.org/struts/browse/STR-2956
>             Project: Struts 1
>          Issue Type: Improvement
>    Affects Versions: 1.0 Final
>            Reporter: Paul Benedict
>             Fix For: 1.3.6
>
>
> Actions always cast a form into the intended subclass. It would be nice to allow the the dispatch classes to match up against the strongly typed methods. Example:
> private ActionForward doMyAction(ActionMapping mapping, MyForm form, HttpServletRequest request, HttpServletResponse response);

-- 
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

        

[jira] Updated: (STR-2956) Strongly typed forms in Action dispatching

Posted by "Paul Benedict (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/struts/browse/STR-2956?page=all ]

Paul Benedict updated STR-2956:
-------------------------------

    Fix Version/s:     (was: 1.3.6)

> Strongly typed forms in Action dispatching
> ------------------------------------------
>
>                 Key: STR-2956
>                 URL: http://issues.apache.org/struts/browse/STR-2956
>             Project: Struts 1
>          Issue Type: Improvement
>    Affects Versions: 1.0 Final
>            Reporter: Paul Benedict
>
> Actions always cast a form into the intended subclass. It would be nice to allow the the dispatch classes to match up against the strongly typed methods. Example:
> private ActionForward doMyAction(ActionMapping mapping, MyForm form, HttpServletRequest request, HttpServletResponse response);

-- 
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

        

[jira] Closed: (STR-2956) Strongly typed forms in Action dispatching

Posted by "Paul Benedict (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/struts/browse/STR-2956?page=all ]

Paul Benedict closed STR-2956.
------------------------------

    Resolution: Won't Fix

In my opinion, it is not worth doing this in 1.x. Perhaps in 2.0 it makes more sense.

> Strongly typed forms in Action dispatching
> ------------------------------------------
>
>                 Key: STR-2956
>                 URL: http://issues.apache.org/struts/browse/STR-2956
>             Project: Struts 1
>          Issue Type: Improvement
>    Affects Versions: 1.0 Final
>            Reporter: Paul Benedict
>             Fix For: 1.3.6
>
>
> Actions always cast a form into the intended subclass. It would be nice to allow the the dispatch classes to match up against the strongly typed methods. Example:
> private ActionForward doMyAction(ActionMapping mapping, MyForm form, HttpServletRequest request, HttpServletResponse response);

-- 
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