mirror of
https://github.com/apache/struts.git
synced 2026-08-05 22:56:59 +00:00
WW-3714 Ensure correct delegation of new Interceptor API
This commit is contained in:
@@ -257,7 +257,7 @@ public class DefaultActionInvocation implements ActionInvocation {
|
||||
resultCode = executeConditional((ConditionalInterceptor) interceptor);
|
||||
} else {
|
||||
LOG.debug("Executing normal interceptor: {}", interceptorMapping.getName());
|
||||
resultCode = interceptor.intercept(this);
|
||||
resultCode = interceptor.intercept((org.apache.struts2.ActionInvocation) this);
|
||||
}
|
||||
} else {
|
||||
resultCode = invokeActionOnly();
|
||||
@@ -298,9 +298,9 @@ public class DefaultActionInvocation implements ActionInvocation {
|
||||
}
|
||||
|
||||
protected String executeConditional(ConditionalInterceptor conditionalInterceptor) throws Exception {
|
||||
if (conditionalInterceptor.shouldIntercept(this)) {
|
||||
if (conditionalInterceptor.shouldIntercept((org.apache.struts2.ActionInvocation) this)) {
|
||||
LOG.debug("Executing conditional interceptor: {}", conditionalInterceptor.getClass().getSimpleName());
|
||||
return conditionalInterceptor.intercept(this);
|
||||
return conditionalInterceptor.intercept((org.apache.struts2.ActionInvocation) this);
|
||||
} else {
|
||||
LOG.debug("Interceptor: {} is disabled, skipping to next", conditionalInterceptor.getClass().getSimpleName());
|
||||
return this.invoke();
|
||||
|
||||
@@ -38,6 +38,11 @@ public abstract class AbstractInterceptor extends org.apache.struts2.interceptor
|
||||
|
||||
@Override
|
||||
public boolean shouldIntercept(ActionInvocation invocation) {
|
||||
return shouldIntercept((org.apache.struts2.ActionInvocation) invocation);
|
||||
return super.shouldIntercept(invocation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldIntercept(org.apache.struts2.ActionInvocation invocation) {
|
||||
return shouldIntercept(ActionInvocation.adapt(invocation));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user