struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (WW-4694) AnnotationWorkflowInterceptor doesn't work with spring proxied action
Date Sun, 05 Feb 2017 14:39:42 GMT


ASF GitHub Bot commented on WW-4694:

GitHub user yasserzamani opened a pull request:

    [WW-4694] annotation processing improved

    With these changes, [AnnotationUtils](
can navigate around proxies, superclasses and interfaces.
    known issue: for keep it simple, currently it does not support [Bridge Methods](

You can merge this pull request into a Git repository by running:

    $ git pull WW-4694

Alternatively you can review and apply these changes as the patch at:

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #117
commit c84b7967e9eb2f6307466b1644977423831d2ef1
Author: Yasser Zamani <>
Date:   2017-02-05T14:24:28Z

    [WW-4694] annotation processing improved in order to navigate around
    proxies, superclasses and interfaces


> AnnotationWorkflowInterceptor doesn't work with spring proxied action
> ---------------------------------------------------------------------
>                 Key: WW-4694
>                 URL:
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core
>            Reporter: zhouyanming
>             Fix For:
> {code:java}
>     public String intercept(ActionInvocation invocation) throws Exception {
>         final Object action = invocation.getAction();
>         invocation.addPreResultListener(this);
>         List<Method> methods = new ArrayList<>(AnnotationUtils.getAnnotatedMethods(action.getClass(),
> {code}
> if action is annotated with @Transactional , AnnotationUtils.getAnnotatedMethods() will
always return empty collection.
> here is my quick fix 
> {code:java}
> 	public static Collection<Method> getAnnotatedMethods(Class clazz, Class<? extends
Annotation>... annotation){
> 		if( SpringProxy.class.isAssignableFrom(clazz) )
> 			clazz = clazz.getSuperclass();
> {code}
> but it will add spring dependence, I hope there is an elegant way.

This message was sent by Atlassian JIRA

View raw message