yes, although I am kind of confused about your first email.

musachy

On Tue, Oct 6, 2009 at 7:50 PM, Alex Siman <aleksandr.si...@gmail.com> wrote:
>
> Is it safe to get ActionInvocation inside of [Interceptor.intercept()] in
> this way?:
>
> ActionInvocation invocation =
> ActionContext.getContext().getActionInvocation();
>
> Alex Siman wrote:
>>
>> Is there any way to refactor method [intercept(ActionInvocation)] to
>> remove ActionInvocation parameter. It is not usable to have this
>> parameter, because it makes refactoring of method interceptor hard.
>>
>> Instead of this:
>>
>> public class SomeInterceptor extends AbstractInterceptor
>> {
>>       @Override
>>       public String intercept(ActionInvocation actionInvocation) throws
>> Exception
>>       {
>>               oneMethod(actionInvocation);
>>               anotherMethod(actionInvocation);
>>               return actionInvocation.invoke();
>>       }
>>
>>       public void oneMethod(ActionInvocation actionInvocation) throws 
>> Exception
>>       {
>>               // code depended on actionInvocation
>>       }
>>
>>       public void anotherMethod(ActionInvocation actionInvocation) throws
>> Exception
>>       {
>>               // code depended on actionInvocation
>>       }
>> }
>>
>> I would like to have this one:
>>
>> public class SomeInterceptor extends AbstractInterceptor
>> {
>>       @Override
>>       public String intercept() throws Exception
>>       {
>>               // get actionInvocation from somewhere
>>               oneMethod();
>>               anotherMethod();
>>               return actionInvocation.invoke();
>>       }
>>
>>       public void oneMethod() throws Exception
>>       {
>>               // get actionInvocation from somewhere
>>       }
>>
>>       public void anotherMethod() throws Exception
>>       {
>>               // get actionInvocation from somewhere
>>       }
>> }
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Refactoring-of-Interceptor.intercept%28ActionInvocation%29-tp25779342p25779697.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to