Quantcast

Property: struts.class.spring.enableAopSupport

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Property: struts.class.spring.enableAopSupport

developer researcher
Hello,

I am using struts 2.5.10.1 with spring-plugin (Spring 4.1.6). According to
the documentation, the default value of
"struts.class.spring.enableAopSupport" is "false"; the description of this
property is "*Uses different logic to construct beans to allow support AOP*";
however I have used the Spring AOP in Actions and in injected objects in
Actions, without using or changing the value of
"struts.class.spring.enableAopSupport" in struts.properties.

So my queries are:

1. What is the difference or impact of set the value of
"struts.class.spring.enableAopSupport" to true?

2. When would it be necessary set the value of
"struts.class.spring.enableAopSupport" to true?

Thanks
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Property: struts.class.spring.enableAopSupport

Lukasz Lenart
2017-05-10 0:30 GMT+02:00 developer researcher
<[hidden email]>:
> Hello,
>
> I am using struts 2.5.10.1 with spring-plugin (Spring 4.1.6). According to
> the documentation, the default value of
> "struts.class.spring.enableAopSupport" is "false"; the description of this
> property is "*Uses different logic to construct beans to allow support AOP*";
> however I have used the Spring AOP in Actions and in injected objects in
> Actions, without using or changing the value of
> "struts.class.spring.enableAopSupport" in struts.properties.

See https://issues.apache.org/jira/browse/WW-4110

> So my queries are:
>
> 1. What is the difference or impact of set the value of
> "struts.class.spring.enableAopSupport" to true?

Different flow of creating a Spring bean, an old approach

> 2. When would it be necessary set the value of
> "struts.class.spring.enableAopSupport" to true?

When it won't work with the flag set to "false"


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

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Property: struts.class.spring.enableAopSupport

Lukasz Lenart
btw. there was a bug, the name of the flag is
"struts.objectFactory.spring.enableAopSupport" - already fixed that
http://struts.apache.org/docs/spring-plugin.html

2017-05-10 8:28 GMT+02:00 Lukasz Lenart <[hidden email]>:

> 2017-05-10 0:30 GMT+02:00 developer researcher
> <[hidden email]>:
>> Hello,
>>
>> I am using struts 2.5.10.1 with spring-plugin (Spring 4.1.6). According to
>> the documentation, the default value of
>> "struts.class.spring.enableAopSupport" is "false"; the description of this
>> property is "*Uses different logic to construct beans to allow support AOP*";
>> however I have used the Spring AOP in Actions and in injected objects in
>> Actions, without using or changing the value of
>> "struts.class.spring.enableAopSupport" in struts.properties.
>
> See https://issues.apache.org/jira/browse/WW-4110
>
>> So my queries are:
>>
>> 1. What is the difference or impact of set the value of
>> "struts.class.spring.enableAopSupport" to true?
>
> Different flow of creating a Spring bean, an old approach
>
>> 2. When would it be necessary set the value of
>> "struts.class.spring.enableAopSupport" to true?
>
> When it won't work with the flag set to "false"
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Property: struts.class.spring.enableAopSupport

developer researcher
Hello Lukasz,

Is curious but I have more problems when the value of "
struts.objectFactory.spring.enableAopSupport" is true that when it is
false. Unlike "https://issues.apache.org/jira/browse/WW-4110" my problem is
not of object injection but of the execution of Spring AOP. It may be a
versions theme of Struts and Spring.

In summary:

1. When struts.objectFactory.spring.enableAopSupport is false
(default): One problem in the scenarios that I have tested.

- AOP on methods of injected objects (in actions): works as expected.
- AOP on methods of actions with results of the default type
(dispacher):There are problems depending on whether the action extends
ActionSupport or not, but they are manageable through Spring configuration.
- AOP on methods of actions with results of json type (using
json-plugin):The exception "OperationNotSupportedException" occurs, I have
not found a solution through configuration.

2. When struts.objectFactory.spring.enableAopSupport is true: Several
problems (exceptions, double execution) in which even the solutions of the
other case do not work. Later I send more details.

Thanks


2017-05-10 1:36 GMT-05:00 Lukasz Lenart <[hidden email]>:

> btw. there was a bug, the name of the flag is
> "struts.objectFactory.spring.enableAopSupport" - already fixed that
> http://struts.apache.org/docs/spring-plugin.html
>
> 2017-05-10 8:28 GMT+02:00 Lukasz Lenart <[hidden email]>:
> > 2017-05-10 0:30 GMT+02:00 developer researcher
> > <[hidden email]>:
> >> Hello,
> >>
> >> I am using struts 2.5.10.1 with spring-plugin (Spring 4.1.6). According
> to
> >> the documentation, the default value of
> >> "struts.class.spring.enableAopSupport" is "false"; the description of
> this
> >> property is "*Uses different logic to construct beans to allow support
> AOP*";
> >> however I have used the Spring AOP in Actions and in injected objects in
> >> Actions, without using or changing the value of
> >> "struts.class.spring.enableAopSupport" in struts.properties.
> >
> > See https://issues.apache.org/jira/browse/WW-4110
> >
> >> So my queries are:
> >>
> >> 1. What is the difference or impact of set the value of
> >> "struts.class.spring.enableAopSupport" to true?
> >
> > Different flow of creating a Spring bean, an old approach
> >
> >> 2. When would it be necessary set the value of
> >> "struts.class.spring.enableAopSupport" to true?
> >
> > When it won't work with the flag set to "false"
> >
> >
> > Regards
> > --
> > Łukasz
> > + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Property: struts.class.spring.enableAopSupport

Lukasz Lenart
2017-05-11 22:15 GMT+02:00 developer researcher
<[hidden email]>:
> Hello Lukasz,
>
> Is curious but I have more problems when the value of "
> struts.objectFactory.spring.enableAopSupport" is true that when it is
> false. Unlike "https://issues.apache.org/jira/browse/WW-4110" my problem is
> not of object injection but of the execution of Spring AOP. It may be a
> versions theme of Struts and Spring.

Thanks, looks like we can mark the flag as deprecated. And maybe you
are right, it can be na issue with different Spring versions.

> In summary:
>
> 1. When struts.objectFactory.spring.enableAopSupport is false
> (default): One problem in the scenarios that I have tested.
>
> - AOP on methods of injected objects (in actions): works as expected.
> - AOP on methods of actions with results of the default type
> (dispacher):There are problems depending on whether the action extends
> ActionSupport or not, but they are manageable through Spring configuration.
> - AOP on methods of actions with results of json type (using
> json-plugin):The exception "OperationNotSupportedException" occurs, I have
> not found a solution through configuration.

Maybe try to prepare a small demo app to demonstrate what problems do you have?



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Property: struts.class.spring.enableAopSupport

developer researcher
Hi Lukasz,

I attached a demo application for the errors/problems encountered when
working with the Spring AOP in Struts 2 web applications:
https://drive.google.com/file/d/0BytJ23ahIM_-Mk5RamFnbWl6bzA/view?usp=sharing


My original application is based on annotations but for the demo
application I used the "struts.xml" file for the actions configuration
which is the natural and default configuration style of struts web
applications, besides I'm not sure how to replicate with annotations some
of the configuration variants for the tests.

There are many variables that I have been manipulating for the tests, which
generates multiple scenarios or test cases, my idea is to cover all but in
parts. These variables are:

1. Actions creation managed by struts or spring
2. Type of result of actions
3. Action classes that extend or not of ActionSupport
4. Use of  "JDK dynamic proxy" or "CGLIB proxy" in the Spring AOP
configuration
5. Set struts.objectFactory.spring.enableAopSupport to true or false
(although I see that it have already marked it as deprecated)

*Test Case 1:*

*Variables:*
1. Actions creation managed by Spring
2. Type of result of action: dispatcher (default)
3. Action classes that extend of ActionSupport
4. Use of  "JDK dynamic proxy" in the Spring AOP configuration
5. Set struts.objectFactory.spring.enableAopSupport to false (default)

*Result:*
1. The advice is executed correctly
2. The action is executed
3. The object injected by Spring is executed correctly
4. *An ERROR occurs in ParametersInterceptor*

*Note:* The error in ParametersInterceptor is solved using "CGLIB proxy"
instead of "JDK dynamic proxy" in the Spring AOP configuration.

*Test Case 2:*
*Variables: *The values of the variables is referential since apparently in
all the combinations the result is the same.
1. Actions creation managed by Spring
2. Type of result of action: json
3. Action classes that not extend of ActionSupport
4. Use of  "JDK dynamic proxy" in the Spring AOP configuration
5. Set struts.objectFactory.spring.enableAopSupport to false (default)

*Result:*
The following exceptions occur:
- javax.naming.OperationNotSupportedException
- java.lang.reflect.InvocationTargetException
- org.apache.struts2.json.JSONException

*Other case:*

In my tests, the problem of null injected objects in "
https://issues.apache.org/jira/browse/WW-4110" occurs when the action
extends from AcctionSupport and the creation of the action is managed by
Struts (using struts.xml file), but I consider that if someone want to use
the Spring's AOP it is logical that the creation of the object where the
AOP will apply must be managed by Spring.

*Considerations for the tests:*

1. Actions creation managed by struts or spring: edit, modify, comment or
uncomment struts.xml and the SpringApplicationContext class
2. Type of result of actions: dispatcher (default): comment or uncomment
the AdviceExample class
@Pointcut("execution(* org.examples.teststruts2xml.
action.LoginAction.execute(..))")
@Pointcut("execution(* org.examples.teststruts2xml.
action.JsonAction.execute(..))")
3. Action classes that extend or not of ActionSupport:  edit, modify,
comment or uncomment the LoginAction or JsonAction classes
4. Use of  "JDK dynamic proxy" or "CGLIB proxy" in the Spring AOP
configuration: comment or uncomment the SpringApplicationContext class
@EnableAspectJAutoProxy(proxyTargetClass = true)
@EnableAspectJAutoProxy
5. Set struts.objectFactory.spring.enableAopSupport to true or false: edit,
modify, comment or uncomment struts.properties

My test environment is: windows 7 64 bit, JDK 1.8.112 and the libraries
included in the POM

Thanks

2017-05-12 1:29 GMT-05:00 Lukasz Lenart <[hidden email]>:

> 2017-05-11 22:15 GMT+02:00 developer researcher
> <[hidden email]>:
> > Hello Lukasz,
> >
> > Is curious but I have more problems when the value of "
> > struts.objectFactory.spring.enableAopSupport" is true that when it is
> > false. Unlike "https://issues.apache.org/jira/browse/WW-4110" my
> problem is
> > not of object injection but of the execution of Spring AOP. It may be a
> > versions theme of Struts and Spring.
>
> Thanks, looks like we can mark the flag as deprecated. And maybe you
> are right, it can be na issue with different Spring versions.
>
> > In summary:
> >
> > 1. When struts.objectFactory.spring.enableAopSupport is false
> > (default): One problem in the scenarios that I have tested.
> >
> > - AOP on methods of injected objects (in actions): works as expected.
> > - AOP on methods of actions with results of the default type
> > (dispacher):There are problems depending on whether the action extends
> > ActionSupport or not, but they are manageable through Spring
> configuration.
> > - AOP on methods of actions with results of json type (using
> > json-plugin):The exception "OperationNotSupportedException" occurs, I
> have
> > not found a solution through configuration.
>
> Maybe try to prepare a small demo app to demonstrate what problems do you
> have?
>
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Property: struts.class.spring.enableAopSupport

developer researcher
Hi,

For some reason the message was cut and the text was incomplete. Here the
rest of the message:

My original application is based on annotations but for the demo
application I used the "struts.xml" file for the actions configuration
which is the natural and default configuration style of struts web
applications, besides I'm not sure how to replicate with annotations some
of the configuration variants for the tests.

There are many variables that I have been manipulating for the tests, which
generates multiple scenarios or test cases, my idea is to cover all but in
parts. These variables are:

1. Actions creation managed by struts or spring
2. Type of result of actions
3. Action classes that extend or not of ActionSupport
4. Use of  "JDK dynamic proxy" or "CGLIB proxy" in the Spring AOP
configuration
5. Set struts.objectFactory.spring.enableAopSupport to true or false
(although I see that it have already marked it as deprecated)

*Test Case 1:*

*Variables:*
1. Actions creation managed by Spring
2. Type of result of action: dispatcher (default)
3. Action classes that extend of ActionSupport
4. Use of  "JDK dynamic proxy" in the Spring AOP configuration
5. Set struts.objectFactory.spring.enableAopSupport to false (default)

*Result:*
1. The advice is executed correctly
2. The action is executed
3. The object injected by Spring is executed correctly
4.* An ERROR occurs in ParametersInterceptor*

*Note:* The error in ParametersInterceptor is solved using "CGLIB proxy"
instead of "JDK dynamic proxy" in the Spring AOP configuration.

*Test Case 2:*
*Variables: *The values of the variables is referential since apparently in
all the combinations the result is the same.
1. Actions creation managed by Spring
2. Type of result of action: json
3. Action classes that not extend of ActionSupport
4. Use of  "JDK dynamic proxy" in the Spring AOP configuration
5. Set struts.objectFactory.spring.enableAopSupport to false (default)

*Result:*
The following exceptions occur:
- javax.naming.OperationNotSupportedException
- java.lang.reflect.InvocationTargetException
- org.apache.struts2.json.JSONException

*Other case:*

In my tests, the problem of null injected objects in "
https://issues.apache.org/jira/browse/WW-4110" occurs when the action
extends from AcctionSupport and the creation of the action is managed by
Struts (using struts.xml file), but I consider that if someone want to use
the Spring's AOP it is logical that the creation of the object where the
AOP will apply must be managed by Spring.

*Considerations for the tests:*

1. Actions creation managed by struts or spring: edit, modify, comment or
uncomment struts.xml and the SpringApplicationContext class
2. Type of result of actions: dispatcher (default): comment or uncomment
the AdviceExample class
@Pointcut("execution(*
org.examples.teststruts2xml.action.LoginAction.execute(..))")
@Pointcut("execution(*
org.examples.teststruts2xml.action.JsonAction.execute(..))")
3. Action classes that extend or not of ActionSupport:  edit, modify,
comment or uncomment the LoginAction or JsonAction classes
4. Use of  "JDK dynamic proxy" or "CGLIB proxy" in the Spring AOP
configuration: comment or uncomment the SpringApplicationContext class
@EnableAspectJAutoProxy(proxyTargetClass = true)
@EnableAspectJAutoProxy
5. Set struts.objectFactory.spring.enableAopSupport to true or false: edit,
modify, comment or uncomment struts.properties

My test environment is: windows 7 64 bit, JDK 1.8.112 and the libraries
included in the POM

Thanks



2017-05-17 20:40 GMT-05:00 developer researcher <
[hidden email]>:

> Hi Lukasz,
>
> I attached a demo application for the errors/problems encountered when
> working with the Spring AOP in Struts 2 web applications:
> https://drive.google.com/file/d/0BytJ23ahIM_-Mk5RamFnbWl6bzA/view?usp=
> sharing
>
> My original application is based on annotations but for the demo
> application I used the "struts.xml" file for the actions configuration
> which is the natural and default configuration style of struts web
> applications, besides I'm not sure how to replicate with annotations some
> of the configuration variants for the tests.
>
> There are many variables that I have been manipulating for the tests,
> which generates multiple scenarios or test cases, my idea is to cover all
> but in parts. These variables are:
>
> 1. Actions creation managed by struts or spring
> 2. Type of result of actions
> 3. Action classes that extend or not of ActionSupport
> 4. Use of  "JDK dynamic proxy" or "CGLIB proxy" in the Spring AOP
> configuration
> 5. Set struts.objectFactory.spring.enableAopSupport to true or false
> (although I see that it have already marked it as deprecated)
>
> *Test Case 1:*
>
> *Variables:*
> 1. Actions creation managed by Spring
> 2. Type of result of action: dispatcher (default)
> 3. Action classes that extend of ActionSupport
> 4. Use of  "JDK dynamic proxy" in the Spring AOP configuration
> 5. Set struts.objectFactory.spring.enableAopSupport to false (default)
>
> *Result:*
> 1. The advice is executed correctly
> 2. The action is executed
> 3. The object injected by Spring is executed correctly
> 4. *An ERROR occurs in ParametersInterceptor*
>
> *Note:* The error in ParametersInterceptor is solved using "CGLIB proxy"
> instead of "JDK dynamic proxy" in the Spring AOP configuration.
>
> *Test Case 2:*
> *Variables: *The values of the variables is referential since apparently
> in all the combinations the result is the same.
> 1. Actions creation managed by Spring
> 2. Type of result of action: json
> 3. Action classes that not extend of ActionSupport
> 4. Use of  "JDK dynamic proxy" in the Spring AOP configuration
> 5. Set struts.objectFactory.spring.enableAopSupport to false (default)
>
> *Result:*
> The following exceptions occur:
> - javax.naming.OperationNotSupportedException
> - java.lang.reflect.InvocationTargetException
> - org.apache.struts2.json.JSONException
>
> *Other case:*
>
> In my tests, the problem of null injected objects in "
> https://issues.apache.org/jira/browse/WW-4110" occurs when the action
> extends from AcctionSupport and the creation of the action is managed by
> Struts (using struts.xml file), but I consider that if someone want to use
> the Spring's AOP it is logical that the creation of the object where the
> AOP will apply must be managed by Spring.
>
> *Considerations for the tests:*
>
> 1. Actions creation managed by struts or spring: edit, modify, comment or
> uncomment struts.xml and the SpringApplicationContext class
> 2. Type of result of actions: dispatcher (default): comment or uncomment
> the AdviceExample class
> @Pointcut("execution(* org.examples.teststruts2xml.ac
> tion.LoginAction.execute(..))")
> @Pointcut("execution(* org.examples.teststruts2xml.ac
> tion.JsonAction.execute(..))")
> 3. Action classes that extend or not of ActionSupport:  edit, modify,
> comment or uncomment the LoginAction or JsonAction classes
> 4. Use of  "JDK dynamic proxy" or "CGLIB proxy" in the Spring AOP
> configuration: comment or uncomment the SpringApplicationContext class
> @EnableAspectJAutoProxy(proxyTargetClass = true)
> @EnableAspectJAutoProxy
> 5. Set struts.objectFactory.spring.enableAopSupport to true or false: edit,
> modify, comment or uncomment struts.properties
>
> My test environment is: windows 7 64 bit, JDK 1.8.112 and the libraries
> included in the POM
>
> Thanks
>
> 2017-05-12 1:29 GMT-05:00 Lukasz Lenart <[hidden email]>:
>
>> 2017-05-11 22:15 GMT+02:00 developer researcher
>> <[hidden email]>:
>> > Hello Lukasz,
>> >
>> > Is curious but I have more problems when the value of "
>> > struts.objectFactory.spring.enableAopSupport" is true that when it is
>> > false. Unlike "https://issues.apache.org/jira/browse/WW-4110" my
>> problem is
>> > not of object injection but of the execution of Spring AOP. It may be a
>> > versions theme of Struts and Spring.
>>
>> Thanks, looks like we can mark the flag as deprecated. And maybe you
>> are right, it can be na issue with different Spring versions.
>>
>> > In summary:
>> >
>> > 1. When struts.objectFactory.spring.enableAopSupport is false
>> > (default): One problem in the scenarios that I have tested.
>> >
>> > - AOP on methods of injected objects (in actions): works as expected.
>> > - AOP on methods of actions with results of the default type
>> > (dispacher):There are problems depending on whether the action extends
>> > ActionSupport or not, but they are manageable through Spring
>> configuration.
>> > - AOP on methods of actions with results of json type (using
>> > json-plugin):The exception "OperationNotSupportedException" occurs, I
>> have
>> > not found a solution through configuration.
>>
>> Maybe try to prepare a small demo app to demonstrate what problems do you
>> have?
>>
>>
>>
>> Regards
>> --
>> Łukasz
>> + 48 606 323 122 http://www.lenart.org.pl/
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
Loading...