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 booleanapplyInterceptor(ActionInvocation invocation) protected abstract StringdoIntercept(ActionInvocation invocation) Subclasses must override to implement the interceptor logic.intercept(ActionInvocation invocation) Override to handle interceptionvoidsetExcludeMethods(String excludeMethods) voidsetIncludeMethods(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:AbstractInterceptorOverride to handle interception- Specified by:
interceptin interfaceInterceptor- Specified by:
interceptin 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
-