Class DispatcherServletRegistrationBean
java.lang.Object
org.springframework.boot.web.servlet.RegistrationBean
org.springframework.boot.web.servlet.DynamicRegistrationBean<ServletRegistration.Dynamic>
org.springframework.boot.web.servlet.ServletRegistrationBean<DispatcherServlet>
org.springframework.boot.autoconfigure.web.servlet.DispatcherServletRegistrationBean
- All Implemented Interfaces:
DispatcherServletPath
,ServletContextInitializer
,Ordered
public class DispatcherServletRegistrationBean
extends ServletRegistrationBean<DispatcherServlet>
implements DispatcherServletPath
ServletRegistrationBean
for the auto-configured DispatcherServlet
. Both
registers the servlet and exposes DispatcherServletPath
information.- Since:
- 2.0.4
- Author:
- Phillip Webb
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ConstructorDescriptionDispatcherServletRegistrationBean
(DispatcherServlet servlet, String path) Create a newDispatcherServletRegistrationBean
instance for the given servlet and path. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addUrlMappings
(String... urlMappings) Add URL mappings, as defined in the Servlet specification, for the servlet.getPath()
Returns the configured path of the dispatcher servlet.void
setUrlMappings
(Collection<String> urlMappings) Set the URL mappings for the servlet.Methods inherited from class org.springframework.boot.web.servlet.ServletRegistrationBean
addRegistration, configure, getDescription, getMultipartConfig, getServlet, getServletName, getUrlMappings, setLoadOnStartup, setMultipartConfig, setServlet, toString
Methods inherited from class org.springframework.boot.web.servlet.DynamicRegistrationBean
addInitParameter, getInitParameters, getOrDeduceName, isAsyncSupported, register, setAsyncSupported, setInitParameters, setName
Methods inherited from class org.springframework.boot.web.servlet.RegistrationBean
getOrder, isEnabled, onStartup, setEnabled, setOrder
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.boot.autoconfigure.web.servlet.DispatcherServletPath
getPrefix, getRelativePath, getServletUrlMapping
-
Constructor Details
-
DispatcherServletRegistrationBean
Create a newDispatcherServletRegistrationBean
instance for the given servlet and path.- Parameters:
servlet
- the dispatcher servletpath
- the dispatcher servlet path
-
-
Method Details
-
getPath
Description copied from interface:DispatcherServletPath
Returns the configured path of the dispatcher servlet.- Specified by:
getPath
in interfaceDispatcherServletPath
- Returns:
- the configured path
-
setUrlMappings
Description copied from class:ServletRegistrationBean
Set the URL mappings for the servlet. If not specified the mapping will default to '/'. This will replace any previously specified mappings.- Overrides:
setUrlMappings
in classServletRegistrationBean<DispatcherServlet>
- Parameters:
urlMappings
- the mappings to set- See Also:
-
addUrlMappings
Description copied from class:ServletRegistrationBean
Add URL mappings, as defined in the Servlet specification, for the servlet.- Overrides:
addUrlMappings
in classServletRegistrationBean<DispatcherServlet>
- Parameters:
urlMappings
- the mappings to add- See Also:
-