[ 
https://issues.apache.org/jira/browse/WW-4472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14352375#comment-14352375
 ] 

A-pZ edited comment on WW-4472 at 3/12/15 2:35 AM:
---------------------------------------------------

I got similar problem!
If one Action class thrown any exception , return no result and response was 
none.

This is a quick note to report , attached stacktrace and Action class.


was (Author: alpha-pz):
IMO, Action class with Spring-AOP don't assume DefaultWorkflowInterceptor ( in 
xwork2 ).
If we use Spring-AOP , implements WorkflowInterceptor or extend 
DefaultWorkflowInterceptor after that extented interceptor register to 
struts.xml.

regards.

> @InputConfig annotation is not working when integrating with spring aop
> -----------------------------------------------------------------------
>
>                 Key: WW-4472
>                 URL: https://issues.apache.org/jira/browse/WW-4472
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Annotations
>    Affects Versions: 2.3.20
>            Reporter: Huang Yujie
>            Priority: Minor
>             Fix For: 2.3.x
>
>
> when configuration an action with the annotation
> {code:java}
>     @Action(value = "/doSubmitCity")
>     @InputConfig(methodName = "validationFail")
>     public void doSubmitCity()
>     { 
>          //The action implementation 
>     }
> {code}
> The action class is integration with spring aop. (CGLIB proxy)
> And use struts validation framework to do the data validation.
> When the data validation fails.  tracing the code to 
> {{DefaultWorkflowInterceptor.java}}
> {code:java}
>     protected String processInputConfig(final Object action, final String 
> method, final String currentResultName) throws Exception {
>         String resultName = currentResultName;
>         InputConfig annotation = action.getClass().getMethod(method, 
> EMPTY_CLASS_ARRAY).getAnnotation(InputConfig.class);
>         if (annotation != null) {
>             if (!annotation.methodName().equals("")) {
>                 Method m = 
> action.getClass().getMethod(annotation.methodName());
>                 resultName = (String) m.invoke(action);
>             } else {
>                 resultName = annotation.resultName();
>             }
>             if (LOG.isDebugEnabled()) {
>                 LOG.debug("Changing result name from [#0] to [#1] because of 
> processing annotation [#2] on action [#3]",
>                         currentResultName, resultName, 
> InputConfig.class.getSimpleName(), action);
>             }
>         }
>         return resultName;
>     }
> {code}
> This code, {{action.getClass().getMethod(method, 
> EMPTY_CLASS_ARRAY).getAnnotation(InputConfig.class)}} cannot get any 
> annotation because the class is proxied.
> The following stack trace is printing in the log:
> {noformat}
> Could not find action or result: /test-extjs/login/doLogin.action
> No result defined for action com.huawei.test.action.login.LoginAction and 
> result input
> at 
> com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:373)
> at 
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:275)
> at 
> com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265)
> at 
> org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
> at 
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
> at 
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
> at 
> com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138)
> at 
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
> at 
> com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:254)
> at 
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
> at 
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
> at 
> com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:254)
> at 
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
> at 
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
> at 
> com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191)
> at 
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
> {noformat}
> But at the same time, the {{@Action}} annotation is still working fine.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to