Class DispatcherServletRegistrationBean
java.lang.Object
org.springframework.boot.web.servlet.RegistrationBean
org.springframework.boot.web.servlet.DynamicRegistrationBean<jakarta.servlet.ServletRegistration.Dynamic>
org.springframework.boot.web.servlet.ServletRegistrationBean<org.springframework.web.servlet.DispatcherServlet>
org.springframework.boot.autoconfigure.web.servlet.DispatcherServletRegistrationBean
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,DispatcherServletPath,org.springframework.boot.web.servlet.ServletContextInitializer,org.springframework.core.Ordered
public class DispatcherServletRegistrationBean
extends org.springframework.boot.web.servlet.ServletRegistrationBean<org.springframework.web.servlet.DispatcherServlet>
implements DispatcherServletPath
ServletRegistrationBean for the auto-configured DispatcherServlet. Both
registers the servlet and exposes DispatcherServletPath information.- Since:
- 2.0.4
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionDispatcherServletRegistrationBean(org.springframework.web.servlet.DispatcherServlet servlet, String path) Create a newDispatcherServletRegistrationBeaninstance for the given servlet and path. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddUrlMappings(String... urlMappings) getPath()Returns the configured path of the dispatcher servlet.voidsetUrlMappings(Collection<String> urlMappings) Methods inherited from class org.springframework.boot.web.servlet.ServletRegistrationBean
addRegistration, configure, getDescription, getMultipartConfig, getServlet, getServletName, getUrlMappings, setLoadOnStartup, setMultipartConfig, setServlet, toStringMethods inherited from class org.springframework.boot.web.servlet.DynamicRegistrationBean
addInitParameter, getInitParameters, getOrDeduceName, isAsyncSupported, register, setAsyncSupported, setBeanName, setIgnoreRegistrationFailure, setInitParameters, setNameMethods inherited from class org.springframework.boot.web.servlet.RegistrationBean
getOrder, isEnabled, onStartup, setEnabled, setOrderMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.boot.autoconfigure.web.servlet.DispatcherServletPath
getPrefix, getRelativePath, getServletUrlMapping
-
Constructor Details
-
DispatcherServletRegistrationBean
public DispatcherServletRegistrationBean(org.springframework.web.servlet.DispatcherServlet servlet, String path) Create a newDispatcherServletRegistrationBeaninstance for the given servlet and path.- Parameters:
servlet- the dispatcher servletpath- the dispatcher servlet path
-
-
Method Details
-
getPath
Description copied from interface:DispatcherServletPathReturns the configured path of the dispatcher servlet.- Specified by:
getPathin interfaceDispatcherServletPath- Returns:
- the configured path
-
setUrlMappings
- Overrides:
setUrlMappingsin classorg.springframework.boot.web.servlet.ServletRegistrationBean<org.springframework.web.servlet.DispatcherServlet>
-
addUrlMappings
- Overrides:
addUrlMappingsin classorg.springframework.boot.web.servlet.ServletRegistrationBean<org.springframework.web.servlet.DispatcherServlet>
-