[prev in list] [next in list] [prev in thread] [next in thread] 

List:       struts-dev
Subject:    [jira] [Updated] (WW-4694) AnnotationWorkflowInterceptor doesn't works with spring proxied action
From:       "Lukasz Lenart (JIRA)" <jira () apache ! org>
Date:       2016-09-30 8:46:20
Message-ID: JIRA.13008795.1475204490000.706344.1475225180527 () Atlassian ! JIRA
[Download RAW message or body]


     [ https://issues.apache.org/jira/browse/WW-4694?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel \
]

Lukasz Lenart updated WW-4694:
------------------------------
    Fix Version/s: 2.5.x

> AnnotationWorkflowInterceptor doesn't works with spring proxied action
> ----------------------------------------------------------------------
> 
> Key: WW-4694
> URL: https://issues.apache.org/jira/browse/WW-4694
> Project: Struts 2
> Issue Type: Bug
> Components: Core
> Reporter: zhouyanming
> Fix For: 2.5.x
> 
> 
> {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(), Before.class)); \
> {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
(v6.3.4#6332)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic