org.apache.struts2.interceptor

## Interface ConditionalInterceptor

- All Superinterfaces:
    Interceptor, Serializable
  All Known Subinterfaces:
    ConditionalInterceptor
  All Known Implementing Classes:
    AbstractFileUploadInterceptor, AbstractInterceptor, AbstractInterceptor, ActionFileUploadInterceptor, ActionMappingParametersInterceptor, AliasInterceptor, AliasInterceptor, AnnotationParameterFilterInterceptor, AnnotationValidationInterceptor, AnnotationWorkflowInterceptor, ChainingInterceptor, ChainingInterceptor, CheckboxInterceptor, ClearSessionInterceptor, CoepInterceptor, ConditionalInterceptor.LegacyAdapter, ConversionErrorInterceptor, ConversionErrorInterceptor, CookieInterceptor, CookieProviderInterceptor, CoopInterceptor, CreateSessionInterceptor, CspInterceptor, DateTextFieldInterceptor, DebuggingInterceptor, DefaultWorkflowInterceptor, DefaultWorkflowInterceptor, ExceptionMappingInterceptor, ExceptionMappingInterceptor, ExecuteAndWaitInterceptor, FetchMetadataInterceptor, FileUploadInterceptor, HttpMethodInterceptor, I18nInterceptor, LoggingInterceptor, LoggingInterceptor, MessageStoreInterceptor, MethodFilterInterceptor, MethodFilterInterceptor, MockInterceptor, ModelDrivenInterceptor, ModelDrivenInterceptor, MultiselectInterceptor, NoOpInterceptor, ParameterFilterInterceptor, ParameterRemoverInterceptor, ParameterRemoverInterceptor, ParametersInterceptor, ParametersInterceptor, PrepareInterceptor, PrepareInterceptor, RolesInterceptor, ScopedModelDrivenInterceptor, ScopedModelDrivenInterceptor, ScopeInterceptor, ServletConfigInterceptor, StaticParametersInterceptor, StaticParametersInterceptor, StrutsConversionErrorInterceptor, TokenInterceptor, TokenSessionStoreInterceptor, ValidationInterceptor

      public interface ConditionalInterceptor
      extends Interceptor

  A marking interface, when implemented allows to conditionally execute a given interceptor within the current action invocation.
  Since:
    Struts 6.1.1

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `shouldIntercept(ActionInvocation invocation)` Determines if a given interceptor should be executed in the current processing of action invocation.

    - ### Methods inherited from interface org.apache.struts2.interceptor.Interceptor

      `destroy, init, intercept`

- - ### Method Detail

    - #### shouldIntercept

          boolean shouldIntercept(ActionInvocation invocation)

      Determines if a given interceptor should be executed in the current processing of action invocation.
      Parameters:
        `invocation` - current `ActionInvocation` to determine if the interceptor should be executed
      Returns:
        true if the given interceptor should be included in the current action invocation
      Since:
        6.1.1

Copyright © 2000–2026 Apache Software Foundation. All rights reserved.