Annotation Interface ServletRegistration


@Target({METHOD,TYPE}) @Retention(RUNTIME) @Documented @Order public @interface ServletRegistration
Registers a Servlet in a Servlet 3.0+ container. Can be used as an annotation-based alternative to ServletRegistrationBean.
Since:
3.5.0
Author:
Moritz Halbritter, Dmytro Danilenkov
See Also:
  • 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
    • 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
    • urlMappings

      String[] urlMappings
      URL mappings for the servlet. If not specified the mapping will default to '/'.
      Returns:
      the url mappings
      Default:
      {}
    • loadOnStartup

      int loadOnStartup
      The loadOnStartup priority. See ServletRegistration.Dynamic.setLoadOnStartup(int) for details.
      Returns:
      the loadOnStartup priority
      Default:
      -1
    • initParameters

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

      MultipartConfig multipartConfig
      The multipart configuration.
      Returns:
      the multipart configuration
      Default:
      @jakarta.servlet.annotation.MultipartConfig