ServletRegistrationBean
A ServletContextInitializer to register Servlets in a Servlet 3.0+ container. Similar to the registration features provided by ServletContext but with a Spring Bean friendly design.
The servlet must be specified before calling onStartup. URL mapping can be configured used setUrlMappings or omitted when mapping to '/*' (unless alwaysMapUrl is set to false
). The servlet name will be deduced if not specified.
Author
Phillip Webb
Since
1.4.0
Parameters
<T>
the type of the Servlet to register
See also
Constructors
Link copied to clipboard
constructor()
Create a new ServletRegistrationBean instance.
Create a new ServletRegistrationBean instance with the specified Servlet and URL mappings.
Create a new ServletRegistrationBean instance with the specified Servlet and URL mappings.
Properties
Functions
Link copied to clipboard
Add a single init-parameter, replacing any existing parameter with the same name.
Link copied to clipboard
Add URL mappings, as defined in the Servlet specification, for the servlet.
Link copied to clipboard
Returns the servlet name that will be registered.
Link copied to clipboard
Return a mutable collection of the URL mappings, as defined in the Servlet specification, for the servlet.
Link copied to clipboard
Returns if asynchronous operations are supported for this registration.
Link copied to clipboard
Sets if asynchronous operations are supported for this registration.
Link copied to clipboard
Flag to indicate that the registration is enabled.
Link copied to clipboard
Sets whether registration failures should be ignored.
Link copied to clipboard
Sets the
loadOnStartup
priority.Link copied to clipboard
Set the URL mappings for the servlet.