You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Nicolas Romanetti (JIRA)" <ji...@apache.org> on 2007/09/12 23:20:34 UTC

[jira] Created: (WW-2174) Prepare interceptor: prepare methods invocation order should be reversed

Prepare interceptor: prepare methods invocation order should be reversed
------------------------------------------------------------------------

                 Key: WW-2174
                 URL: https://issues.apache.org/struts/browse/WW-2174
             Project: Struts 2
          Issue Type: Improvement
          Components: Interceptors
    Affects Versions: 2.0.9
         Environment: xwork
            Reporter: Nicolas Romanetti



  Hello,

before the actionMethodName() is called, the prepare interceptor calls
prepare<ActionMethodName>()  and then prepare()

First usage pattern is: I do not need prepareXxxx, I use only prepare
2d usage pattern is: I do need prepareXxxx, but I do not need prepare at all, so my prepare method simply does nothing
3d usage pattern is: I need both 

Usage patterns 1 and 2 are OK, however the 3d pattern usage is in my opinion not well supported by this interceptor.

You need such a feature when your action class regroups several action methods and you need to factorize some preparation.
In my opinion, the factorized preparation, prepare(), should be called first and not after the specialized preparation, prepareXxx(). 

Indeed, prepare is not supposed to be aware of the action method called, so it cannot really do something useful in between 
prepare<actionMethodName>() and the actionMethodName() itself.
However, if called before, the prepare<actionMethodName>() could benefit from it.

I suggest to simply reverse the calling order. I understand this would be a major change. We could simply make it configurable...

Regards,
Nicolas.


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


[jira] Commented: (WW-2174) Prepare interceptor: prepare methods invocation order should be reversed

Posted by "Ralf Fischer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45489#action_45489 ] 

Ralf Fischer commented on WW-2174:
----------------------------------

Would this change not be subject to xwork rather than to struts?

com.opensymphony.xwork2.interceptor.PrepareInterceptor ...


> Prepare interceptor: prepare methods invocation order should be reversed
> ------------------------------------------------------------------------
>
>                 Key: WW-2174
>                 URL: https://issues.apache.org/struts/browse/WW-2174
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Core Interceptors
>    Affects Versions: 2.0.9
>         Environment: xwork
>            Reporter: Nicolas Romanetti
>             Fix For: Future
>
>
>   Hello,
> before the actionMethodName() is called, the prepare interceptor calls
> prepare<ActionMethodName>()  and then prepare()
> First usage pattern is: I do not need prepareXxxx, I use only prepare
> 2d usage pattern is: I do need prepareXxxx, but I do not need prepare at all, so my prepare method simply does nothing
> 3d usage pattern is: I need both 
> Usage patterns 1 and 2 are OK, however the 3d pattern usage is in my opinion not well supported by this interceptor.
> You need such a feature when your action class regroups several action methods and you need to factorize some preparation.
> In my opinion, the factorized preparation, prepare(), should be called first and not after the specialized preparation, prepareXxx(). 
> Indeed, prepare is not supposed to be aware of the action method called, so it cannot really do something useful in between 
> prepare<actionMethodName>() and the actionMethodName() itself.
> However, if called before, the prepare<actionMethodName>() could benefit from it.
> I suggest to simply reverse the calling order. I understand this would be a major change. We could simply make it configurable...
> Regards,
> Nicolas.

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


[jira] Updated: (WW-2174) Prepare interceptor: prepare methods invocation order should be reversed

Posted by "Musachy Barroso (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2174?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Musachy Barroso updated WW-2174:
--------------------------------

    Fix Version/s:     (was: Future)
                   2.1.9

lets add a flag to the interceptor to specify the order

> Prepare interceptor: prepare methods invocation order should be reversed
> ------------------------------------------------------------------------
>
>                 Key: WW-2174
>                 URL: https://issues.apache.org/struts/browse/WW-2174
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Core Interceptors
>    Affects Versions: 2.0.9
>         Environment: xwork
>            Reporter: Nicolas Romanetti
>             Fix For: 2.1.9
>
>
>   Hello,
> before the actionMethodName() is called, the prepare interceptor calls
> prepare<ActionMethodName>()  and then prepare()
> First usage pattern is: I do not need prepareXxxx, I use only prepare
> 2d usage pattern is: I do need prepareXxxx, but I do not need prepare at all, so my prepare method simply does nothing
> 3d usage pattern is: I need both 
> Usage patterns 1 and 2 are OK, however the 3d pattern usage is in my opinion not well supported by this interceptor.
> You need such a feature when your action class regroups several action methods and you need to factorize some preparation.
> In my opinion, the factorized preparation, prepare(), should be called first and not after the specialized preparation, prepareXxx(). 
> Indeed, prepare is not supposed to be aware of the action method called, so it cannot really do something useful in between 
> prepare<actionMethodName>() and the actionMethodName() itself.
> However, if called before, the prepare<actionMethodName>() could benefit from it.
> I suggest to simply reverse the calling order. I understand this would be a major change. We could simply make it configurable...
> Regards,
> Nicolas.

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


[jira] Updated: (WW-2174) Prepare interceptor: prepare methods invocation order should be reversed

Posted by "James Holmes (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2174?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James Holmes updated WW-2174:
-----------------------------

    Fix Version/s: Future

> Prepare interceptor: prepare methods invocation order should be reversed
> ------------------------------------------------------------------------
>
>                 Key: WW-2174
>                 URL: https://issues.apache.org/struts/browse/WW-2174
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Interceptors
>    Affects Versions: 2.0.9
>         Environment: xwork
>            Reporter: Nicolas Romanetti
>             Fix For: Future
>
>
>   Hello,
> before the actionMethodName() is called, the prepare interceptor calls
> prepare<ActionMethodName>()  and then prepare()
> First usage pattern is: I do not need prepareXxxx, I use only prepare
> 2d usage pattern is: I do need prepareXxxx, but I do not need prepare at all, so my prepare method simply does nothing
> 3d usage pattern is: I need both 
> Usage patterns 1 and 2 are OK, however the 3d pattern usage is in my opinion not well supported by this interceptor.
> You need such a feature when your action class regroups several action methods and you need to factorize some preparation.
> In my opinion, the factorized preparation, prepare(), should be called first and not after the specialized preparation, prepareXxx(). 
> Indeed, prepare is not supposed to be aware of the action method called, so it cannot really do something useful in between 
> prepare<actionMethodName>() and the actionMethodName() itself.
> However, if called before, the prepare<actionMethodName>() could benefit from it.
> I suggest to simply reverse the calling order. I understand this would be a major change. We could simply make it configurable...
> Regards,
> Nicolas.

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