类 DispatcherServletRegistrationBean
- java.lang.Object
- org.springframework.boot.web.servlet.RegistrationBean
- org.springframework.boot.web.servlet.DynamicRegistrationBean<javax.servlet.ServletRegistration.Dynamic>
- org.springframework.boot.web.servlet.ServletRegistrationBean<org.springframework.web.servlet.DispatcherServlet>
- org.springframework.boot.autoconfigure.web.servlet.DispatcherServletRegistrationBean
- 所有已实现的接口:
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
ServletRegistrationBeanfor the auto-configuredDispatcherServlet. Both registers the servlet and exposesDispatcherServletPathinformation.- 从以下版本开始:
- 2.0.4
构造器概要
构造器 构造器 说明 DispatcherServletRegistrationBean(org.springframework.web.servlet.DispatcherServlet servlet, String path)Create a newDispatcherServletRegistrationBeaninstance for the given servlet and path.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidaddUrlMappings(String... urlMappings)StringgetPath()Returns the configured path of the dispatcher servlet.voidsetUrlMappings(Collection<String> urlMappings)从类继承的方法 org.springframework.boot.web.servlet.ServletRegistrationBean
addRegistration, configure, getDescription, getMultipartConfig, getServlet, getServletName, getUrlMappings, setLoadOnStartup, setMultipartConfig, setServlet, toString
从类继承的方法 org.springframework.boot.web.servlet.DynamicRegistrationBean
addInitParameter, getInitParameters, getOrDeduceName, isAsyncSupported, register, setAsyncSupported, setInitParameters, setName
从类继承的方法 org.springframework.boot.web.servlet.RegistrationBean
getOrder, isEnabled, onStartup, setEnabled, setOrder
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
从接口继承的方法 org.springframework.boot.autoconfigure.web.servlet.DispatcherServletPath
getPrefix, getRelativePath, getServletUrlMapping
构造器详细资料
DispatcherServletRegistrationBean
public DispatcherServletRegistrationBean(org.springframework.web.servlet.DispatcherServlet servlet, String path)
Create a newDispatcherServletRegistrationBeaninstance for the given servlet and path.- 参数:
servlet- the dispatcher servletpath- the dispatcher servlet path
方法详细资料
getPath
public String getPath()
从接口复制的说明:DispatcherServletPathReturns the configured path of the dispatcher servlet.- 指定者:
getPath在接口中DispatcherServletPath- 返回:
- the configured path
setUrlMappings
public void setUrlMappings(Collection<String> urlMappings)
- 覆盖:
setUrlMappings在类中org.springframework.boot.web.servlet.ServletRegistrationBean<org.springframework.web.servlet.DispatcherServlet>
addUrlMappings
public void addUrlMappings(String... urlMappings)
- 覆盖:
addUrlMappings在类中org.springframework.boot.web.servlet.ServletRegistrationBean<org.springframework.web.servlet.DispatcherServlet>