类 RegistrationBean
java.lang.Object
org.springframework.boot.web.servlet.RegistrationBean
- 所有已实现的接口:
ServletContextInitializer
,Ordered
Base class for Servlet 3.0+ based registration beans.
- 从以下版本开始:
- 1.4.0
- 作者:
- Phillip Webb
- 另请参阅:
-
字段概要
从接口继承的字段 org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明protected abstract String
Return a description of the registration.int
getOrder()
Get the order of the registration bean.boolean
Return if the registration is enabled.final void
onStartup
(ServletContext servletContext) Configure the givenServletContext
with any servlets, filters, listeners context-params and attributes necessary for initialization.protected abstract void
register
(String description, ServletContext servletContext) Register this bean with the servlet context.void
setEnabled
(boolean enabled) Flag to indicate that the registration is enabled.void
setOrder
(int order) Set the order of the registration bean.
-
构造器详细资料
-
RegistrationBean
public RegistrationBean()
-
-
方法详细资料
-
onStartup
从接口复制的说明:ServletContextInitializer
Configure the givenServletContext
with any servlets, filters, listeners context-params and attributes necessary for initialization.- 指定者:
onStartup
在接口中ServletContextInitializer
- 参数:
servletContext
- theServletContext
to initialize- 抛出:
ServletException
- if any call against the givenServletContext
throws aServletException
-
getDescription
Return a description of the registration. For example "Servlet resourceServlet"- 返回:
- a description of the registration
-
register
Register this bean with the servlet context.- 参数:
description
- a description of the item being registeredservletContext
- the servlet context
-
setEnabled
public void setEnabled(boolean enabled) Flag to indicate that the registration is enabled.- 参数:
enabled
- the enabled to set
-
isEnabled
public boolean isEnabled()Return if the registration is enabled.- 返回:
- if enabled (default
true
)
-
setOrder
public void setOrder(int order) Set the order of the registration bean.- 参数:
order
- the order
-
getOrder
public int getOrder()Get the order of the registration bean.
-