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

XWork - Overriding interceptors in sub package (XW-554)

I would like a feature in XWork that allows sub packages to override
interceptors in the interceptor stacks
(http://jira.opensymphony.com/browse/XW-554). What I want is that if I
define an interceptor in a package with a name that already exists in
parent packages, I want all the stacks that are using this interceptor
to use the one defined in the local package instead, but only for this
package and it's sub packages. The reason I want to be able to do this
is so that I don't have to redefine all the stacks with my new
interceptor, which would be particularly useful with the portlet
plugin, which needs some tweaks to existing interceptors for them to
work in a portlet environment. This is an area of XWork I have little
experience with, and I've been digging through the XWork code base,
but I have not yet found out how to achieve this. I guess I could
either override the interceptors "configuration time", or at runtime.
I'm not sure what happens when, and if/how I can modify the behaviour
to do what I want. So if anyone have any ideas and pointers to where
to start, I'd be grateful.

Nils-H

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


Re: XWork - Overriding interceptors in sub package (XW-554)

Posted by Nils-Helge Garli Hegvik <ni...@gmail.com>.
This is really taking my head for a spin.... I assume doing this would
require copying and re-defining programatically all interceptor stacks
from super packages if an overriding interceptor is defined... I'm
more and more tempted to just leave this feature request alone and
just duplicate all the required configuration, since it aparently only
affects the portlet plugin...

Nils-H

On Thu, Apr 9, 2009 at 8:35 PM, Musachy Barroso <mu...@gmail.com> wrote:
> I think you have to do it at configuration time. Configuration is
> immutable, once it is built, you cannot change it, so I don't think
> the runtime is an option.
>
> musachy
>
> On Thu, Apr 9, 2009 at 2:11 PM, Nils-Helge Garli Hegvik
> <ni...@gmail.com> wrote:
>> I would like a feature in XWork that allows sub packages to override
>> interceptors in the interceptor stacks
>> (http://jira.opensymphony.com/browse/XW-554). What I want is that if I
>> define an interceptor in a package with a name that already exists in
>> parent packages, I want all the stacks that are using this interceptor
>> to use the one defined in the local package instead, but only for this
>> package and it's sub packages. The reason I want to be able to do this
>> is so that I don't have to redefine all the stacks with my new
>> interceptor, which would be particularly useful with the portlet
>> plugin, which needs some tweaks to existing interceptors for them to
>> work in a portlet environment. This is an area of XWork I have little
>> experience with, and I've been digging through the XWork code base,
>> but I have not yet found out how to achieve this. I guess I could
>> either override the interceptors "configuration time", or at runtime.
>> I'm not sure what happens when, and if/how I can modify the behaviour
>> to do what I want. So if anyone have any ideas and pointers to where
>> to start, I'd be grateful.
>>
>> Nils-H
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>> For additional commands, e-mail: dev-help@struts.apache.org
>>
>>
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>

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


Re: XWork - Overriding interceptors in sub package (XW-554)

Posted by Musachy Barroso <mu...@gmail.com>.
I think you have to do it at configuration time. Configuration is
immutable, once it is built, you cannot change it, so I don't think
the runtime is an option.

musachy

On Thu, Apr 9, 2009 at 2:11 PM, Nils-Helge Garli Hegvik
<ni...@gmail.com> wrote:
> I would like a feature in XWork that allows sub packages to override
> interceptors in the interceptor stacks
> (http://jira.opensymphony.com/browse/XW-554). What I want is that if I
> define an interceptor in a package with a name that already exists in
> parent packages, I want all the stacks that are using this interceptor
> to use the one defined in the local package instead, but only for this
> package and it's sub packages. The reason I want to be able to do this
> is so that I don't have to redefine all the stacks with my new
> interceptor, which would be particularly useful with the portlet
> plugin, which needs some tweaks to existing interceptors for them to
> work in a portlet environment. This is an area of XWork I have little
> experience with, and I've been digging through the XWork code base,
> but I have not yet found out how to achieve this. I guess I could
> either override the interceptors "configuration time", or at runtime.
> I'm not sure what happens when, and if/how I can modify the behaviour
> to do what I want. So if anyone have any ideas and pointers to where
> to start, I'd be grateful.
>
> Nils-H
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>



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

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


Re: XWork - Overriding interceptors in sub package (XW-554)

Posted by Musachy Barroso <mu...@gmail.com>.
Configuration is semi-inmutable(oxymoron?), you can add and remove
packages, but you cannot modify an action config, or a package config.
You can also reload the whole configuration, which is what Convention
and the XML config do when files are modified.

musachy

On Fri, Apr 24, 2009 at 1:05 PM, Rene Gielen <gi...@it-neering.net> wrote:
> although hard to realize, I find the idea really intriguing. Given e.g.
> you would provide a NoOperationInterceptor, it would let you selectively
> disable interceptors when needed, without repeating stack configs.
> Given the configuration immutability, how does the JavaRebel Struts2
> plugin work - anybody knows?
>
> Nils-Helge Garli Hegvik schrieb:
>> I would like a feature in XWork that allows sub packages to override
>> interceptors in the interceptor stacks
>> (http://jira.opensymphony.com/browse/XW-554). What I want is that if I
>> define an interceptor in a package with a name that already exists in
>> parent packages, I want all the stacks that are using this interceptor
>> to use the one defined in the local package instead, but only for this
>> package and it's sub packages. The reason I want to be able to do this
>> is so that I don't have to redefine all the stacks with my new
>> interceptor, which would be particularly useful with the portlet
>> plugin, which needs some tweaks to existing interceptors for them to
>> work in a portlet environment. This is an area of XWork I have little
>> experience with, and I've been digging through the XWork code base,
>> but I have not yet found out how to achieve this. I guess I could
>> either override the interceptors "configuration time", or at runtime.
>> I'm not sure what happens when, and if/how I can modify the behaviour
>> to do what I want. So if anyone have any ideas and pointers to where
>> to start, I'd be grateful.
>>
>> Nils-H
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>> For additional commands, e-mail: dev-help@struts.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>



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

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


Re: XWork - Overriding interceptors in sub package (XW-554)

Posted by Rene Gielen <gi...@it-neering.net>.
although hard to realize, I find the idea really intriguing. Given e.g.
you would provide a NoOperationInterceptor, it would let you selectively
disable interceptors when needed, without repeating stack configs.
Given the configuration immutability, how does the JavaRebel Struts2
plugin work - anybody knows?

Nils-Helge Garli Hegvik schrieb:
> I would like a feature in XWork that allows sub packages to override
> interceptors in the interceptor stacks
> (http://jira.opensymphony.com/browse/XW-554). What I want is that if I
> define an interceptor in a package with a name that already exists in
> parent packages, I want all the stacks that are using this interceptor
> to use the one defined in the local package instead, but only for this
> package and it's sub packages. The reason I want to be able to do this
> is so that I don't have to redefine all the stacks with my new
> interceptor, which would be particularly useful with the portlet
> plugin, which needs some tweaks to existing interceptors for them to
> work in a portlet environment. This is an area of XWork I have little
> experience with, and I've been digging through the XWork code base,
> but I have not yet found out how to achieve this. I guess I could
> either override the interceptors "configuration time", or at runtime.
> I'm not sure what happens when, and if/how I can modify the behaviour
> to do what I want. So if anyone have any ideas and pointers to where
> to start, I'd be grateful.
> 
> Nils-H
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
> 

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