Annotation 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
- See Also:
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionboolean
Whether asynchronous operations are supported for this registration.boolean
Whether this registration is enabled.boolean
Whether registration failures should be ignored.jakarta.servlet.annotation.WebInitParam[]
Init parameters to be used with the servlet.int
TheloadOnStartup
priority.jakarta.servlet.annotation.MultipartConfig
The multipart configuration.Name of this registration.int
Order of the registration bean.String[]
URL mappings for the servlet.
-
Element Details
-
enabled
boolean enabledWhether this registration is enabled.- Returns:
- whether this registration is enabled
- Default:
- true
-
order
@AliasFor(annotation=org.springframework.core.annotation.Order.class, attribute="value") int orderOrder of the registration bean.- Returns:
- the order of the registration bean
- Default:
- 2147483647
-
name
String nameName of this registration. If not specified the bean name will be used.- Returns:
- the name
- Default:
- ""
-
asyncSupported
boolean asyncSupportedWhether asynchronous operations are supported for this registration.- Returns:
- whether asynchronous operations are supported
- Default:
- true
-
ignoreRegistrationFailure
boolean ignoreRegistrationFailureWhether registration failures should be ignored. If set to true, a failure will be logged. If set to false, anIllegalStateException
will be thrown.- Returns:
- whether registration failures should be ignored
- Default:
- false
-
urlMappings
String[] urlMappingsURL mappings for the servlet. If not specified the mapping will default to '/'.- Returns:
- the url mappings
- Default:
- {}
-
loadOnStartup
int loadOnStartupTheloadOnStartup
priority. SeeServletRegistration.Dynamic.setLoadOnStartup(int)
for details.- Returns:
- the
loadOnStartup
priority
- Default:
- -1
-
initParameters
jakarta.servlet.annotation.WebInitParam[] initParametersInit parameters to be used with the servlet.- Returns:
- the init parameters
- Default:
- {}
-
multipartConfig
jakarta.servlet.annotation.MultipartConfig multipartConfigThe multipart configuration.- Returns:
- the multipart configuration
- Default:
- @jakarta.servlet.annotation.MultipartConfig
-