You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Lukasz Lenart (JIRA)" <ji...@apache.org> on 2010/03/26 12:38:27 UTC

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

     [ https://issues.apache.org/jira/browse/WW-2174?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lukasz Lenart resolved WW-2174.
-------------------------------

    Resolution: Fixed
      Assignee: Lukasz Lenart

Flag added - firstCallPrepareDo by default set to false the call order will be like that:
- prepare
- prepareDo


> Prepare interceptor: prepare methods invocation order should be reversed
> ------------------------------------------------------------------------
>
>                 Key: WW-2174
>                 URL: https://issues.apache.org/jira/browse/WW-2174
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Core Interceptors
>    Affects Versions: 2.0.9
>         Environment: xwork
>            Reporter: Nicolas Chalumeau
>            Assignee: Lukasz Lenart
>             Fix For: 2.2.0
>
>
>   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.