struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "zhouyanming (JIRA)" <>
Subject [jira] [Created] (WW-4694) AnnotationWorkflowInterceptor doesn't works with spring proxied action
Date Fri, 30 Sep 2016 03:02:20 GMT
zhouyanming created WW-4694:

             Summary: AnnotationWorkflowInterceptor doesn't works with spring proxied action
                 Key: WW-4694
             Project: Struts 2
          Issue Type: Bug
          Components: Core
            Reporter: zhouyanming

    public String intercept(ActionInvocation invocation) throws Exception {
        final Object action = invocation.getAction();
        List<Method> methods = new ArrayList<>(AnnotationUtils.getAnnotatedMethods(action.getClass(),
if action is annotated with @Transactional , AnnotationUtils.getAnnotatedMethods() will always
return empty collection.
here is my quick fix 
	public static Collection<Method> getAnnotatedMethods(Class clazz, Class<? extends
Annotation>... annotation){
		if( SpringProxy.class.isAssignableFrom(clazz) )
			clazz = clazz.getSuperclass();
but it will add spring dependence, I hope there is an elegant way.

This message was sent by Atlassian JIRA

View raw message