You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by sudeepj2ee <su...@gmail.com> on 2007/05/24 08:49:15 UTC

calling particular method in the interceptor

can we call a particular method in interceptor class as we do for action
class like
<action name="abc!*" method="{1}"
                                class="abc">

can we do the same for interceptors using '!' can i call a particular method
with my own name in interceptor.
If yes than how can we do that.

Thanks in advance
sudeep srivastava

sudeepj2ee@gmail.com

-- 
View this message in context: http://www.nabble.com/calling-particular-method-in-the-interceptor-tf3808341.html#a10778391
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: calling particular method in the interceptor

Posted by sudeepj2ee <su...@gmail.com>.


Thanks Jeromy it really worked

Jeromy Evans - Blue Sky Minds wrote:
> 
> public String intercept(ActionInvocation actionInvocation) throws 
> Exception {
> 
> I wouldn't do it, but actionInvocation provides information about the 
> action and method being invoked.  Your interceptor could change its 
> behaviour based on the action name/class or method.
> 
> The preferred approach (I believe) is to add an interface to your action 
> and have your interceptor check whether the action implements the 
> interface. Then act accordingly, irrespective of the action name.
> 
> sudeepj2ee wrote:
>> can we call a particular method in interceptor class as we do for action
>> class like
>> <action name="abc!*" method="{1}"
>>                                 class="abc">
>>
>> can we do the same for interceptors using '!' can i call a particular
>> method
>> with my own name in interceptor.
>> If yes than how can we do that.
>>
>> Thanks in advance
>> sudeep srivastava
>>
>> sudeepj2ee@gmail.com
>>
>>   
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/calling-particular-method-in-the-interceptor-tf3808341.html#a10780795
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: calling particular method in the interceptor

Posted by Jeromy Evans <je...@blueskyminds.com.au>.
public String intercept(ActionInvocation actionInvocation) throws 
Exception {

I wouldn't do it, but actionInvocation provides information about the 
action and method being invoked.  Your interceptor could change its 
behaviour based on the action name/class or method.

The preferred approach (I believe) is to add an interface to your action 
and have your interceptor check whether the action implements the 
interface. Then act accordingly, irrespective of the action name.

sudeepj2ee wrote:
> can we call a particular method in interceptor class as we do for action
> class like
> <action name="abc!*" method="{1}"
>                                 class="abc">
>
> can we do the same for interceptors using '!' can i call a particular method
> with my own name in interceptor.
> If yes than how can we do that.
>
> Thanks in advance
> sudeep srivastava
>
> sudeepj2ee@gmail.com
>
>   


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