Annotation Interface FilterRegistration


@Target({METHOD,TYPE}) @Retention(RUNTIME) @Documented @Order public @interface FilterRegistration
Registers a Filter in a Servlet 3.0+ container. Can be used as an annotation-based alternative to FilterRegistrationBean.
Since:
3.5.0
Author:
Moritz Halbritter, Daeho Kwon
See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Whether asynchronous operations are supported for this registration.
    Dispatcher types that should be used with the registration.
    boolean
    Whether this registration is enabled.
    boolean
    Whether registration failures should be ignored.
    Init parameters to be used with the filter.
    boolean
    Whether the filter mappings should be matched after any declared Filter mappings of the ServletContext.
    Name of this registration.
    int
    Order of the registration bean.
    Class<?>[]
    Servlet classes that the filter will be registered against.
    Servlet names that the filter will be registered against.
    URL patterns, as defined in the Servlet specification, that the filter will be registered against.
  • Element Details

    • enabled

      boolean enabled
      Whether this registration is enabled.
      Returns:
      whether this registration is enabled
      Default:
      true
    • order

      Order of the registration bean.
      Returns:
      the order of the registration bean
      Default:
      2147483647
    • name

      String name
      Name of this registration. If not specified the bean name will be used.
      Returns:
      the name
      Default:
      ""
    • asyncSupported

      boolean asyncSupported
      Whether asynchronous operations are supported for this registration.
      Returns:
      whether asynchronous operations are supported
      Default:
      true
    • dispatcherTypes

      DispatcherType[] dispatcherTypes
      Dispatcher types that should be used with the registration.
      Returns:
      the dispatcher types
      Default:
      {}
    • ignoreRegistrationFailure

      boolean ignoreRegistrationFailure
      Whether registration failures should be ignored. If set to true, a failure will be logged. If set to false, an IllegalStateException will be thrown.
      Returns:
      whether registration failures should be ignored
      Default:
      false
    • initParameters

      WebInitParam[] initParameters
      Init parameters to be used with the filter.
      Returns:
      the init parameters
      Default:
      {}
    • matchAfter

      boolean matchAfter
      Whether the filter mappings should be matched after any declared Filter mappings of the ServletContext.
      Returns:
      whether the filter mappings should be matched after any declared Filter mappings of the ServletContext
      Default:
      false
    • servletNames

      String[] servletNames
      Servlet names that the filter will be registered against.
      Returns:
      the servlet names
      Default:
      {}
    • servletClasses

      Class<?>[] servletClasses
      Servlet classes that the filter will be registered against.
      Returns:
      the servlet classes
      Default:
      {}
    • urlPatterns

      String[] urlPatterns
      URL patterns, as defined in the Servlet specification, that the filter will be registered against.
      Returns:
      the url patterns
      Default:
      {}