类 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
ServletRegistrationBean
for the auto-configuredDispatcherServlet
. Both registers the servlet and exposesDispatcherServletPath
information.- 从以下版本开始:
- 2.0.4
构造器概要
构造器 构造器 说明 DispatcherServletRegistrationBean(org.springframework.web.servlet.DispatcherServlet servlet, String path)
Create a newDispatcherServletRegistrationBean
instance for the given servlet and path.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
addUrlMappings(String... urlMappings)
String
getPath()
Returns the configured path of the dispatcher servlet.void
setUrlMappings(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 newDispatcherServletRegistrationBean
instance for the given servlet and path.- 参数:
servlet
- the dispatcher servletpath
- the dispatcher servlet path
方法详细资料
getPath
public String getPath()
从接口复制的说明:DispatcherServletPath
Returns 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>