You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Nils-Helge Garli Hegvik <ni...@gmail.com> on 2009/04/03 07:46:34 UTC

Re: how to re-init / update parameter of an interceptor during runtime?

Why do you need to do that?

Nils-H

On Fri, Apr 3, 2009 at 5:05 AM, Joe Lam <jo...@moni-media.net> wrote:
>
> I got this in action mapping
> <interceptor-ref name="MyInterceptor">
>        value01
> </interceptor-ref>
>
> that parameter actually is an instance property of that interceptor
> instance.
>
> private String param01;
> public void setParam01(String value){
>        param01= value;
> }
>
> I wonder if it is possible to call again the setter method via API during
> runtime to change the interceptor behavior.
>
> thanks.
>
> Joe
> --
> View this message in context: http://www.nabble.com/how-to-re-init---update-parameter-of-an-interceptor-during-runtime--tp22861150p22861150.html
> 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
>
>

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


Re: how to re-init / update parameter of an interceptor during runtime?

Posted by mu...@aol.com.
 Since interceptors are not thread safe I would look at manipulating fields from a given thread with a jaundiced eye.
Chris M.


 


 

-----Original Message-----
From: Nils-Helge Garli Hegvik <ni...@gmail.com>
To: Struts Users Mailing List <us...@struts.apache.org>
Sent: Fri, 3 Apr 2009 1:46 am
Subject: Re: how to re-init / update parameter of an interceptor during  runtime?










Why do you need to do that?

Nils-H

On Fri, Apr 3, 2009 at 5:05 AM, Joe Lam <jo...@moni-media.net> wrote:
>
> I got this in action mapping
> <interceptor-ref name="MyInterceptor">
> ? ? ? ?value01
> </interceptor-ref>
>
> that parameter actually is an instance property of that interceptor
> instance.
>
> private String param01;
> public void setParam01(String value){
> ? ? ? ?param01= value;
> }
>
> I wonder if it is possible to call again the setter method via API during
> runtime to change the interceptor behavior.
>
> thanks.
>
> Joe
> --
> View this message in context: http://www.nabble.com/how-to-re-init---update-parameter-of-an-interceptor-during-runtime--tp22861150p22861150.html
> 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
>
>

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



 


Re: how to re-init / update parameter of an interceptor during runtime?

Posted by mu...@aol.com.
 


 An interceptor has access to application via ActionContext so it is easy to rig up. From anywhere in your application you can manipulate an entry in application and have the interceptor check if it matches the value it currently has. I still think it is an unorthodox approach though. It also costs you time as your intercept() method now has that extra check.
Chris M


 

-----Original Message-----
From: Joe Lam <jo...@moni-media.net>
To: user@struts.apache.org
Sent: Fri, 3 Apr 2009 2:48 am
Subject: Re: how to re-init / update parameter of an interceptor during runtime?











thx for your reply.

actually I am not going to change the param regularly.
this is more like "just in case I want to change the setting in the future".

thx

Joe


Nils-Helge Garli wrote:
> 
> Why do you need to do that?
> 
> Nils-H
> 
> On Fri, Apr 3, 2009 at 5:05 AM, Joe Lam <jo...@moni-media.net> wrote:
>>
>> I got this in action mapping
>> <interceptor-ref name="MyInterceptor">
>> ? ? ? ?value01
>> </interceptor-ref>
>>
>> that parameter actually is an instance property of that interceptor
>> instance.
>>
>> private String param01;
>> public void setParam01(String value){
>> ? ? ? ?param01= value;
>> }
>>
>> I wonder if it is possible to call again the setter method via API during
>> runtime to change the interceptor behavior.
>>
>> thanks.
>>
>> Joe
>> --
>> View this message in context:
>> http://www.nabble.com/how-to-re-init---update-parameter-of-an-interceptor-during-runtime--tp22861150p22861150.html
>> 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
>>
>>
> 
> ---------------------------------------------------------------------
> 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/how-to-re-init---update-parameter-of-an-interceptor-during-runtime--tp22861150p22862897.html
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: how to re-init / update parameter of an interceptor during runtime?

Posted by Joe Lam <jo...@moni-media.net>.
thx for your reply.

actually I am not going to change the param regularly.
this is more like "just in case I want to change the setting in the future".

thx

Joe


Nils-Helge Garli wrote:
> 
> Why do you need to do that?
> 
> Nils-H
> 
> On Fri, Apr 3, 2009 at 5:05 AM, Joe Lam <jo...@moni-media.net> wrote:
>>
>> I got this in action mapping
>> <interceptor-ref name="MyInterceptor">
>>        value01
>> </interceptor-ref>
>>
>> that parameter actually is an instance property of that interceptor
>> instance.
>>
>> private String param01;
>> public void setParam01(String value){
>>        param01= value;
>> }
>>
>> I wonder if it is possible to call again the setter method via API during
>> runtime to change the interceptor behavior.
>>
>> thanks.
>>
>> Joe
>> --
>> View this message in context:
>> http://www.nabble.com/how-to-re-init---update-parameter-of-an-interceptor-during-runtime--tp22861150p22861150.html
>> 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
>>
>>
> 
> ---------------------------------------------------------------------
> 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/how-to-re-init---update-parameter-of-an-interceptor-during-runtime--tp22861150p22862897.html
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