Package org.apache.struts2.interceptor
Class MethodFilterInterceptor
java.lang.Object
org.apache.struts2.interceptor.AbstractInterceptor
org.apache.struts2.interceptor.MethodFilterInterceptor
- All Implemented Interfaces:
Serializable
,ConditionalInterceptor
,Interceptor
- Direct Known Subclasses:
ConversionErrorInterceptor
,DefaultWorkflowInterceptor
,ExecuteAndWaitInterceptor
,ParametersInterceptor
,PrepareInterceptor
,TokenInterceptor
,ValidationInterceptor
MethodFilterInterceptor is an abstract Interceptor
used as
a base class for interceptors that will filter execution based on method
names according to specified included/excluded method lists.
- excludeMethods - method names to be excluded from interceptor processing
- includeMethods - method names to be included in interceptor processing
NOTE: If method name are available in both includeMethods and excludeMethods, it will be considered as an included method: includeMethods takes precedence over excludeMethods.
Interceptors that extends this capability include:- TokenInterceptor
- TokenSessionStoreInterceptor
- DefaultWorkflowInterceptor
- ValidationInterceptor
- Author:
- Alexandru Popescu, Rainer Hermanns
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
applyInterceptor
(ActionInvocation invocation) protected abstract String
doIntercept
(ActionInvocation invocation) Subclasses must override to implement the interceptor logic.intercept
(ActionInvocation invocation) Override to handle interceptionvoid
setExcludeMethods
(String excludeMethods) void
setIncludeMethods
(String includeMethods) Methods inherited from class org.apache.struts2.interceptor.AbstractInterceptor
destroy, init, setDisabled, shouldIntercept
-
Field Details
-
excludeMethods
-
includeMethods
-
-
Constructor Details
-
MethodFilterInterceptor
public MethodFilterInterceptor()
-
-
Method Details
-
setExcludeMethods
-
getExcludeMethodsSet
-
setIncludeMethods
-
getIncludeMethodsSet
-
intercept
Description copied from class:AbstractInterceptor
Override to handle interception- Specified by:
intercept
in interfaceInterceptor
- Specified by:
intercept
in classAbstractInterceptor
- Parameters:
invocation
- the action invocation- Returns:
- the return code, either returned from
ActionInvocation.invoke()
, or from the interceptor itself. - Throws:
Exception
- any system-level error, as defined inAction.execute()
.
-
applyInterceptor
-
doIntercept
Subclasses must override to implement the interceptor logic.- Parameters:
invocation
- the action invocation- Returns:
- the result of invocation
- Throws:
Exception
- in case of any errors
-