You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Lukasz Lenart <lu...@apache.org> on 2014/07/02 17:09:13 UTC

Re: dynamic interceptor insertion

2014-06-27 10:44 GMT+02:00 Gildas de Cadoudal <gi...@gmail.com>:
> Hi all,
>
> I would like to dynamically insert an interceptor to a specific place
> in existing stack.
> Of course I also like the stacks referencing the one where I insert
> the interceptor also take advantage of this configuration change.
>
> Practicable to do this? I started to look on the side of
> PackageProvider, but I can not find sufficiently complete
> documentation allowing me to do this.

Without large changes it isn't possible to change interceptor stack at
runtime, it should be only possible to create a new stack with
PackageProvider


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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


Re: dynamic interceptor insertion

Posted by Gildas de Cadoudal <gi...@gmail.com>.
no i don't have problems with jar detection, thanks
/**
 * Gildas de Cadoudal
 * 115, rue Mazarin
 * 33000 Bordeaux
 * (+33) (0)6 60 13 80 90
 * (+33) (0)9 50 15 62 40
 * gildas.de.cadoudal@gmail.com
 **/


On Tue, Jul 8, 2014 at 12:39 PM, Lukasz Lenart <lu...@apache.org> wrote:
> 2014-07-08 12:36 GMT+02:00 Gildas de Cadoudal <gi...@gmail.com>:
>> To clarify, my need: I want to allow the inclusion of a library in the
>> classpath enable features brought by it without changing the
>> configuration of the main project.
>
> If just want to detect a jar on classpath take a look on LoggerFactory
> - it detects different loggers based on ClassNotFoundException ;-)
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> 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: dynamic interceptor insertion

Posted by Lukasz Lenart <lu...@apache.org>.
2014-07-08 12:36 GMT+02:00 Gildas de Cadoudal <gi...@gmail.com>:
> To clarify, my need: I want to allow the inclusion of a library in the
> classpath enable features brought by it without changing the
> configuration of the main project.

If just want to detect a jar on classpath take a look on LoggerFactory
- it detects different loggers based on ClassNotFoundException ;-)


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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


Re: dynamic interceptor insertion

Posted by Lukasz Lenart <lu...@apache.org>.
2014-07-09 20:01 GMT+02:00 Gildas de Cadoudal <gi...@gmail.com>:
> thanks Lukasz, but ActionProxy#getConfig()#getInterceptors() lists the
> interceptors but not the name of the stack used by the action

You can always @Inject Configuration and traverse over it, anyway
without large changes inside S2 it isn't possible to simple inject
interceptor. I think the simplest option is to mark action with
interface to activate given interceptor. In the same way as
ServletConfigInterceptor injects request (RequestAware), session
(SessionAware) and so on.


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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


Re: dynamic interceptor insertion

Posted by Gildas de Cadoudal <gi...@gmail.com>.
thanks Lukasz, but ActionProxy#getConfig()#getInterceptors() lists the
interceptors but not the name of the stack used by the action
/**
 * Gildas de Cadoudal
 * 115, rue Mazarin
 * 33000 Bordeaux
 * (+33) (0)6 60 13 80 90
 * (+33) (0)9 50 15 62 40
 * gildas.de.cadoudal@gmail.com
 **/


On Wed, Jul 9, 2014 at 7:37 PM, Lukasz Lenart <lu...@apache.org> wrote:
> 2014-07-08 15:30 GMT+02:00 Gildas de Cadoudal <gi...@gmail.com>:
>> ActionInvocation.getStack () does not give the interceptor stack, at
>> least that's what I think
>
> No it doesn't
>
>> I want to know the stack to insert an interceptor to the execution of
>> actions using particular stack.
>
> ActionProxy#getConfig()#getInterceptors()
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> 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: dynamic interceptor insertion

Posted by Lukasz Lenart <lu...@apache.org>.
2014-07-08 15:30 GMT+02:00 Gildas de Cadoudal <gi...@gmail.com>:
> ActionInvocation.getStack () does not give the interceptor stack, at
> least that's what I think

No it doesn't

> I want to know the stack to insert an interceptor to the execution of
> actions using particular stack.

ActionProxy#getConfig()#getInterceptors()


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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


Re: dynamic interceptor insertion

Posted by Gildas de Cadoudal <gi...@gmail.com>.
ActionInvocation.getStack () does not give the interceptor stack, at
least that's what I think
I want to know the stack to insert an interceptor to the execution of
actions using particular stack.
/**
 * Gildas de Cadoudal
 * 115, rue Mazarin
 * 33000 Bordeaux
 * (+33) (0)6 60 13 80 90
 * (+33) (0)9 50 15 62 40
 * gildas.de.cadoudal@gmail.com
 **/


On Tue, Jul 8, 2014 at 2:06 PM, Martin Gainty <mg...@hotmail.com> wrote:
>
>
>
>> From: gildas.de.cadoudal@gmail.com
>> Date: Tue, 8 Jul 2014 12:36:14 +0200
>> Subject: Re: dynamic interceptor insertion
>> To: dev@struts.apache.org
>>
>> I look towards the ActionInvocation or ActionProxyFactory but the
>> problem with this solution is that we do not know what Stack is
>> executed.
> MG> ValueStack ActionInvocation.getStack();
> MG>?
> MG>ActionProxyFactory
> MG>ActionProxy createActionProxy(ActionInvocation actionInvocation, String namespace, String actionName, String methodName,boolean executeResult, boolean cleanupContext);
> MG>save the actionInvocation
> MG>when you need it reference the actionInvocation.getStack()
> MG>?
>
>> I also look towards a placeholder, but the problem is the same as previously.
>>
>> To clarify, my need: I want to allow the inclusion of a library in the
>> classpath enable features brought by it without changing the
>> configuration of the main project.
> MG>perhaps inclusion of library as a <dependency> in your maven pom.xml would satisfy this requirement?
>
>>
>> I hope you understand, because I know that my English is very bad (I'm french)
> MG>Si les commentaires sont professionnels (vous obtiendrez toujours une réponse polie)
> MG>Bon Chance
>> /**
>>  * Gildas de Cadoudal
>>  * 115, rue Mazarin
>>  * 33000 Bordeaux
>>  * (+33) (0)6 60 13 80 90
>>  * (+33) (0)9 50 15 62 40
>>  * gildas.de.cadoudal@gmail.com
>>  **/
>>
>>
>> On Thu, Jul 3, 2014 at 10:16 AM, Greg Huber <gr...@gmail.com> wrote:
>> > What would be useful, if you could have a place holder in the interceptor
>> > stack and then inject the interceptor element you need on the action?
>> >
>> > Copying the whole lot each time makes a lot more maintenance and more prone
>> > to errors.
>> >
>> >
>> > On 3 July 2014 02:32, Paul Benedict <pb...@apache.org> wrote:
>> >
>> >> Most of the time, if not 99% of the time, all I want to do is add an
>> >> interceptor before or after some known interceptor. As I've gone on record
>> >> before, I want this feature too :-)
>> >>
>> >>
>> >>
>> >> Cheers,
>> >> Paul
>> >>
>> >>
>> >> On Wed, Jul 2, 2014 at 7:16 PM, Ken McWilliams <ke...@gmail.com>
>> >> wrote:
>> >>
>> >> > Thank you Lukasz I'll put it on my todo list ;)
>> >> >
>> >> > Martin, interceptor stacks are efficient I think the scope struts2 has is
>> >> > very good, still it is fun to push boundaries, one of those fun higher
>> >> > initiatives would be a Web IDE for struts2. You could dynamically build
>> >> an
>> >> > interceptor stack, and you could step though the stack keeping an eye on
>> >> > the action as part of the debug process, (values before and after
>> >> > interceptor)...
>> >> >
>> >> > So in short no there isn't anything that can't be done with non dynamic
>> >> > stacks, but in the name of learning this web framework and making things
>> >> > more efficient- being able to dynamically alter the stacks is very
>> >> > interesting. At the end the the day the idea was to write out a
>> >> non-dynamic
>> >> > struts.xml for production deployment.
>> >> >
>> >> >
>> >> > On Wed, Jul 2, 2014 at 1:12 PM, Lukasz Lenart <lu...@apache.org>
>> >> > wrote:
>> >> >
>> >> > > 2014-07-02 19:38 GMT+02:00 Ken McWilliams <ke...@gmail.com>:
>> >> > > > This is somethings I've wanted to do (dynamically change the
>> >> > interceptor
>> >> > > > stack), I'm not at a development machine so have not checked the
>> >> > > > plausibility of the following but would like input:
>> >> > > >
>> >> > > > Is it possible to create a custom ActionInvocation object, for this
>> >> > > purpose?
>> >> > > > Is it possible to essentially recreate the functionality of
>> >> > > > ActionInvocation within an interceptor which then delegates to other
>> >> > > > interceptors?
>> >> > >
>> >> > > Hm... yeah, with custom ActionInvocation and ActionProxyFactory should
>> >> > > do the trick, check the REST Plugin to see what must be implemented to
>> >> > > create your own ActionInvocation
>> >> > >
>> >> > >
>> >> > > Regards
>> >> > > --
>> >> > > Łukasz
>> >> > > + 48 606 323 122 http://www.lenart.org.pl/
>> >> > >
>> >> > > ---------------------------------------------------------------------
>> >> > > 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
>>
>

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


RE: dynamic interceptor insertion

Posted by Martin Gainty <mg...@hotmail.com>.


> From: gildas.de.cadoudal@gmail.com
> Date: Tue, 8 Jul 2014 12:36:14 +0200
> Subject: Re: dynamic interceptor insertion
> To: dev@struts.apache.org
> 
> I look towards the ActionInvocation or ActionProxyFactory but the
> problem with this solution is that we do not know what Stack is
> executed.
MG> ValueStack ActionInvocation.getStack(); 
MG>?
MG>ActionProxyFactory
MG>ActionProxy createActionProxy(ActionInvocation actionInvocation, String namespace, String actionName, String methodName,boolean executeResult, boolean cleanupContext);
MG>save the actionInvocation
MG>when you need it reference the actionInvocation.getStack()
MG>?

> I also look towards a placeholder, but the problem is the same as previously.
> 
> To clarify, my need: I want to allow the inclusion of a library in the
> classpath enable features brought by it without changing the
> configuration of the main project.
MG>perhaps inclusion of library as a <dependency> in your maven pom.xml would satisfy this requirement?

> 
> I hope you understand, because I know that my English is very bad (I'm french)
MG>Si les commentaires sont professionnels (vous obtiendrez toujours une réponse polie)
MG>Bon Chance
> /**
>  * Gildas de Cadoudal
>  * 115, rue Mazarin
>  * 33000 Bordeaux
>  * (+33) (0)6 60 13 80 90
>  * (+33) (0)9 50 15 62 40
>  * gildas.de.cadoudal@gmail.com
>  **/
> 
> 
> On Thu, Jul 3, 2014 at 10:16 AM, Greg Huber <gr...@gmail.com> wrote:
> > What would be useful, if you could have a place holder in the interceptor
> > stack and then inject the interceptor element you need on the action?
> >
> > Copying the whole lot each time makes a lot more maintenance and more prone
> > to errors.
> >
> >
> > On 3 July 2014 02:32, Paul Benedict <pb...@apache.org> wrote:
> >
> >> Most of the time, if not 99% of the time, all I want to do is add an
> >> interceptor before or after some known interceptor. As I've gone on record
> >> before, I want this feature too :-)
> >>
> >>
> >>
> >> Cheers,
> >> Paul
> >>
> >>
> >> On Wed, Jul 2, 2014 at 7:16 PM, Ken McWilliams <ke...@gmail.com>
> >> wrote:
> >>
> >> > Thank you Lukasz I'll put it on my todo list ;)
> >> >
> >> > Martin, interceptor stacks are efficient I think the scope struts2 has is
> >> > very good, still it is fun to push boundaries, one of those fun higher
> >> > initiatives would be a Web IDE for struts2. You could dynamically build
> >> an
> >> > interceptor stack, and you could step though the stack keeping an eye on
> >> > the action as part of the debug process, (values before and after
> >> > interceptor)...
> >> >
> >> > So in short no there isn't anything that can't be done with non dynamic
> >> > stacks, but in the name of learning this web framework and making things
> >> > more efficient- being able to dynamically alter the stacks is very
> >> > interesting. At the end the the day the idea was to write out a
> >> non-dynamic
> >> > struts.xml for production deployment.
> >> >
> >> >
> >> > On Wed, Jul 2, 2014 at 1:12 PM, Lukasz Lenart <lu...@apache.org>
> >> > wrote:
> >> >
> >> > > 2014-07-02 19:38 GMT+02:00 Ken McWilliams <ke...@gmail.com>:
> >> > > > This is somethings I've wanted to do (dynamically change the
> >> > interceptor
> >> > > > stack), I'm not at a development machine so have not checked the
> >> > > > plausibility of the following but would like input:
> >> > > >
> >> > > > Is it possible to create a custom ActionInvocation object, for this
> >> > > purpose?
> >> > > > Is it possible to essentially recreate the functionality of
> >> > > > ActionInvocation within an interceptor which then delegates to other
> >> > > > interceptors?
> >> > >
> >> > > Hm... yeah, with custom ActionInvocation and ActionProxyFactory should
> >> > > do the trick, check the REST Plugin to see what must be implemented to
> >> > > create your own ActionInvocation
> >> > >
> >> > >
> >> > > Regards
> >> > > --
> >> > > Łukasz
> >> > > + 48 606 323 122 http://www.lenart.org.pl/
> >> > >
> >> > > ---------------------------------------------------------------------
> >> > > 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: dynamic interceptor insertion

Posted by Gildas de Cadoudal <gi...@gmail.com>.
I look towards the ActionInvocation or ActionProxyFactory but the
problem with this solution is that we do not know what Stack is
executed.
I also look towards a placeholder, but the problem is the same as previously.

To clarify, my need: I want to allow the inclusion of a library in the
classpath enable features brought by it without changing the
configuration of the main project.

I hope you understand, because I know that my English is very bad (I'm french)
/**
 * Gildas de Cadoudal
 * 115, rue Mazarin
 * 33000 Bordeaux
 * (+33) (0)6 60 13 80 90
 * (+33) (0)9 50 15 62 40
 * gildas.de.cadoudal@gmail.com
 **/


On Thu, Jul 3, 2014 at 10:16 AM, Greg Huber <gr...@gmail.com> wrote:
> What would be useful, if you could have a place holder in the interceptor
> stack and then inject the interceptor element you need on the action?
>
> Copying the whole lot each time makes a lot more maintenance and more prone
> to errors.
>
>
> On 3 July 2014 02:32, Paul Benedict <pb...@apache.org> wrote:
>
>> Most of the time, if not 99% of the time, all I want to do is add an
>> interceptor before or after some known interceptor. As I've gone on record
>> before, I want this feature too :-)
>>
>>
>>
>> Cheers,
>> Paul
>>
>>
>> On Wed, Jul 2, 2014 at 7:16 PM, Ken McWilliams <ke...@gmail.com>
>> wrote:
>>
>> > Thank you Lukasz I'll put it on my todo list ;)
>> >
>> > Martin, interceptor stacks are efficient I think the scope struts2 has is
>> > very good, still it is fun to push boundaries, one of those fun higher
>> > initiatives would be a Web IDE for struts2. You could dynamically build
>> an
>> > interceptor stack, and you could step though the stack keeping an eye on
>> > the action as part of the debug process, (values before and after
>> > interceptor)...
>> >
>> > So in short no there isn't anything that can't be done with non dynamic
>> > stacks, but in the name of learning this web framework and making things
>> > more efficient- being able to dynamically alter the stacks is very
>> > interesting. At the end the the day the idea was to write out a
>> non-dynamic
>> > struts.xml for production deployment.
>> >
>> >
>> > On Wed, Jul 2, 2014 at 1:12 PM, Lukasz Lenart <lu...@apache.org>
>> > wrote:
>> >
>> > > 2014-07-02 19:38 GMT+02:00 Ken McWilliams <ke...@gmail.com>:
>> > > > This is somethings I've wanted to do (dynamically change the
>> > interceptor
>> > > > stack), I'm not at a development machine so have not checked the
>> > > > plausibility of the following but would like input:
>> > > >
>> > > > Is it possible to create a custom ActionInvocation object, for this
>> > > purpose?
>> > > > Is it possible to essentially recreate the functionality of
>> > > > ActionInvocation within an interceptor which then delegates to other
>> > > > interceptors?
>> > >
>> > > Hm... yeah, with custom ActionInvocation and ActionProxyFactory should
>> > > do the trick, check the REST Plugin to see what must be implemented to
>> > > create your own ActionInvocation
>> > >
>> > >
>> > > Regards
>> > > --
>> > > Łukasz
>> > > + 48 606 323 122 http://www.lenart.org.pl/
>> > >
>> > > ---------------------------------------------------------------------
>> > > 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: dynamic interceptor insertion

Posted by Greg Huber <gr...@gmail.com>.
What would be useful, if you could have a place holder in the interceptor
stack and then inject the interceptor element you need on the action?

Copying the whole lot each time makes a lot more maintenance and more prone
to errors.


On 3 July 2014 02:32, Paul Benedict <pb...@apache.org> wrote:

> Most of the time, if not 99% of the time, all I want to do is add an
> interceptor before or after some known interceptor. As I've gone on record
> before, I want this feature too :-)
>
>
>
> Cheers,
> Paul
>
>
> On Wed, Jul 2, 2014 at 7:16 PM, Ken McWilliams <ke...@gmail.com>
> wrote:
>
> > Thank you Lukasz I'll put it on my todo list ;)
> >
> > Martin, interceptor stacks are efficient I think the scope struts2 has is
> > very good, still it is fun to push boundaries, one of those fun higher
> > initiatives would be a Web IDE for struts2. You could dynamically build
> an
> > interceptor stack, and you could step though the stack keeping an eye on
> > the action as part of the debug process, (values before and after
> > interceptor)...
> >
> > So in short no there isn't anything that can't be done with non dynamic
> > stacks, but in the name of learning this web framework and making things
> > more efficient- being able to dynamically alter the stacks is very
> > interesting. At the end the the day the idea was to write out a
> non-dynamic
> > struts.xml for production deployment.
> >
> >
> > On Wed, Jul 2, 2014 at 1:12 PM, Lukasz Lenart <lu...@apache.org>
> > wrote:
> >
> > > 2014-07-02 19:38 GMT+02:00 Ken McWilliams <ke...@gmail.com>:
> > > > This is somethings I've wanted to do (dynamically change the
> > interceptor
> > > > stack), I'm not at a development machine so have not checked the
> > > > plausibility of the following but would like input:
> > > >
> > > > Is it possible to create a custom ActionInvocation object, for this
> > > purpose?
> > > > Is it possible to essentially recreate the functionality of
> > > > ActionInvocation within an interceptor which then delegates to other
> > > > interceptors?
> > >
> > > Hm... yeah, with custom ActionInvocation and ActionProxyFactory should
> > > do the trick, check the REST Plugin to see what must be implemented to
> > > create your own ActionInvocation
> > >
> > >
> > > Regards
> > > --
> > > Łukasz
> > > + 48 606 323 122 http://www.lenart.org.pl/
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: dev-help@struts.apache.org
> > >
> > >
> >
>

Re: dynamic interceptor insertion

Posted by Paul Benedict <pb...@apache.org>.
Most of the time, if not 99% of the time, all I want to do is add an
interceptor before or after some known interceptor. As I've gone on record
before, I want this feature too :-)



Cheers,
Paul


On Wed, Jul 2, 2014 at 7:16 PM, Ken McWilliams <ke...@gmail.com>
wrote:

> Thank you Lukasz I'll put it on my todo list ;)
>
> Martin, interceptor stacks are efficient I think the scope struts2 has is
> very good, still it is fun to push boundaries, one of those fun higher
> initiatives would be a Web IDE for struts2. You could dynamically build an
> interceptor stack, and you could step though the stack keeping an eye on
> the action as part of the debug process, (values before and after
> interceptor)...
>
> So in short no there isn't anything that can't be done with non dynamic
> stacks, but in the name of learning this web framework and making things
> more efficient- being able to dynamically alter the stacks is very
> interesting. At the end the the day the idea was to write out a non-dynamic
> struts.xml for production deployment.
>
>
> On Wed, Jul 2, 2014 at 1:12 PM, Lukasz Lenart <lu...@apache.org>
> wrote:
>
> > 2014-07-02 19:38 GMT+02:00 Ken McWilliams <ke...@gmail.com>:
> > > This is somethings I've wanted to do (dynamically change the
> interceptor
> > > stack), I'm not at a development machine so have not checked the
> > > plausibility of the following but would like input:
> > >
> > > Is it possible to create a custom ActionInvocation object, for this
> > purpose?
> > > Is it possible to essentially recreate the functionality of
> > > ActionInvocation within an interceptor which then delegates to other
> > > interceptors?
> >
> > Hm... yeah, with custom ActionInvocation and ActionProxyFactory should
> > do the trick, check the REST Plugin to see what must be implemented to
> > create your own ActionInvocation
> >
> >
> > Regards
> > --
> > Łukasz
> > + 48 606 323 122 http://www.lenart.org.pl/
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> > For additional commands, e-mail: dev-help@struts.apache.org
> >
> >
>

RE: dynamic interceptor insertion

Posted by Martin Gainty <mg...@hotmail.com>.

> Date: Wed, 2 Jul 2014 18:16:11 -0600
> Subject: Re: dynamic interceptor insertion
> From: ken.mcwilliams@gmail.com
> To: dev@struts.apache.org
> 
> Thank you Lukasz I'll put it on my todo list ;)
> 
> Martin, interceptor stacks are efficient I think the scope struts2 has is
> very good, still it is fun to push boundaries, one of those fun higher
> initiatives would be a Web IDE for struts2. You could dynamically build an
> interceptor stack, and you could step though the stack keeping an eye on
> the action as part of the debug process, (values before and after
> interceptor)...
> 
> So in short no there isn't anything that can't be done with non dynamic
> stacks, but in the name of learning this web framework and making things
> more efficient- being able to dynamically alter the stacks is very
> interesting. At the end the the day the idea was to write out a non-dynamic
> struts.xml for production deployment.
MG>http://struts.apache.org/release/2.0.x/docs/architecture.html
MG>class reflection and introspection using classloaders are usually the first step away from configuration (towards DI)
MG>with DI (specifically Guice DI) configuration files are almost impossible to locate in any framework using factory pattern
MG>looking at the above Struts architecture doc do you see perhaps StrutsBean as Spring AOP crosscut object traversing 
MG>interceptor(s)?
MG>action?
MG>once this dynamic architecture has been refactored to accomodate DI (using crosscutting objects or CL reflection?)
MG>building out a plugin (for eclipse) to export these DI(crosscutting?) features to the perspective could be achieved
MG>curious as to what you and Lukasz think what the new dynamic architecture should look like?
MG>thanks, Martin
> 
> 
> On Wed, Jul 2, 2014 at 1:12 PM, Lukasz Lenart <lu...@apache.org>
> wrote:
> 
> > 2014-07-02 19:38 GMT+02:00 Ken McWilliams <ke...@gmail.com>:
> > > This is somethings I've wanted to do (dynamically change the interceptor
> > > stack), I'm not at a development machine so have not checked the
> > > plausibility of the following but would like input:
> > >
> > > Is it possible to create a custom ActionInvocation object, for this
> > purpose?
> > > Is it possible to essentially recreate the functionality of
> > > ActionInvocation within an interceptor which then delegates to other
> > > interceptors?
> >
> > Hm... yeah, with custom ActionInvocation and ActionProxyFactory should
> > do the trick, check the REST Plugin to see what must be implemented to
> > create your own ActionInvocation
> >
> >
> > Regards
> > --
> > Łukasz
> > + 48 606 323 122 http://www.lenart.org.pl/
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> > For additional commands, e-mail: dev-help@struts.apache.org
> >
> >
 		 	   		  

Re: dynamic interceptor insertion

Posted by Ken McWilliams <ke...@gmail.com>.
Thank you Lukasz I'll put it on my todo list ;)

Martin, interceptor stacks are efficient I think the scope struts2 has is
very good, still it is fun to push boundaries, one of those fun higher
initiatives would be a Web IDE for struts2. You could dynamically build an
interceptor stack, and you could step though the stack keeping an eye on
the action as part of the debug process, (values before and after
interceptor)...

So in short no there isn't anything that can't be done with non dynamic
stacks, but in the name of learning this web framework and making things
more efficient- being able to dynamically alter the stacks is very
interesting. At the end the the day the idea was to write out a non-dynamic
struts.xml for production deployment.


On Wed, Jul 2, 2014 at 1:12 PM, Lukasz Lenart <lu...@apache.org>
wrote:

> 2014-07-02 19:38 GMT+02:00 Ken McWilliams <ke...@gmail.com>:
> > This is somethings I've wanted to do (dynamically change the interceptor
> > stack), I'm not at a development machine so have not checked the
> > plausibility of the following but would like input:
> >
> > Is it possible to create a custom ActionInvocation object, for this
> purpose?
> > Is it possible to essentially recreate the functionality of
> > ActionInvocation within an interceptor which then delegates to other
> > interceptors?
>
> Hm... yeah, with custom ActionInvocation and ActionProxyFactory should
> do the trick, check the REST Plugin to see what must be implemented to
> create your own ActionInvocation
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>

Re: dynamic interceptor insertion

Posted by Lukasz Lenart <lu...@apache.org>.
2014-07-02 19:38 GMT+02:00 Ken McWilliams <ke...@gmail.com>:
> This is somethings I've wanted to do (dynamically change the interceptor
> stack), I'm not at a development machine so have not checked the
> plausibility of the following but would like input:
>
> Is it possible to create a custom ActionInvocation object, for this purpose?
> Is it possible to essentially recreate the functionality of
> ActionInvocation within an interceptor which then delegates to other
> interceptors?

Hm... yeah, with custom ActionInvocation and ActionProxyFactory should
do the trick, check the REST Plugin to see what must be implemented to
create your own ActionInvocation


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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


RE: dynamic interceptor insertion

Posted by Martin Gainty <mg...@hotmail.com>.
> Date: Wed, 2 Jul 2014 11:38:13 -0600
> Subject: Re: dynamic interceptor insertion
> From: ken.mcwilliams@gmail.com
> To: dev@struts.apache.org
> 
> This is somethings I've wanted to do (dynamically change the interceptor
> stack), I'm not at a development machine so have not checked the
> plausibility of the following but would like input:
> 
> Is it possible to create a custom ActionInvocation object, for this purpose?
> Is it possible to essentially recreate the functionality of
> ActionInvocation within an interceptor which then delegates to other
> interceptors?
> 
> 
> On Wed, Jul 2, 2014 at 9:09 AM, Lukasz Lenart <lu...@apache.org>
> wrote:
> 
> > 2014-06-27 10:44 GMT+02:00 Gildas de Cadoudal <
> > gildas.de.cadoudal@gmail.com>:
> > > Hi all,
> > >
> > > I would like to dynamically insert an interceptor to a specific place
> > > in existing stack.
> > > Of course I also like the stacks referencing the one where I insert
> > > the interceptor also take advantage of this configuration change.
> > >
> > > Practicable to do this? I started to look on the side of
> > > PackageProvider, but I can not find sufficiently complete
> > > documentation allowing me to do this.
> >
> > Without large changes it isn't possible to change interceptor stack at
> > runtime, it should be only possible to create a new stack with
> > PackageProvider
MG>as borne out by testcase com.opensymphony.xwork2.config.ConfigurationTest
   public void testInitForPackageProviders() {
        loadConfigurationProviders(new StubConfigurationProvider() {
            @Override
            public void register(ContainerBuilder builder,
                    LocatableProperties props) throws ConfigurationException {
                builder.factory(PackageProvider.class, "foo", MyPackageProvider.class);
            }
        });
MG>ken are there reasons why you would not want to use interceptor stack?
> >
> >
> > Regards
> > --
> > Łukasz
> > + 48 606 323 122 http://www.lenart.org.pl/
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> > For additional commands, e-mail: dev-help@struts.apache.org
> >
> >
 		 	   		  

Re: dynamic interceptor insertion

Posted by Ken McWilliams <ke...@gmail.com>.
This is somethings I've wanted to do (dynamically change the interceptor
stack), I'm not at a development machine so have not checked the
plausibility of the following but would like input:

Is it possible to create a custom ActionInvocation object, for this purpose?
Is it possible to essentially recreate the functionality of
ActionInvocation within an interceptor which then delegates to other
interceptors?


On Wed, Jul 2, 2014 at 9:09 AM, Lukasz Lenart <lu...@apache.org>
wrote:

> 2014-06-27 10:44 GMT+02:00 Gildas de Cadoudal <
> gildas.de.cadoudal@gmail.com>:
> > Hi all,
> >
> > I would like to dynamically insert an interceptor to a specific place
> > in existing stack.
> > Of course I also like the stacks referencing the one where I insert
> > the interceptor also take advantage of this configuration change.
> >
> > Practicable to do this? I started to look on the side of
> > PackageProvider, but I can not find sufficiently complete
> > documentation allowing me to do this.
>
> Without large changes it isn't possible to change interceptor stack at
> runtime, it should be only possible to create a new stack with
> PackageProvider
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>