接口 ConfigurableServletWebServerFactory
- 所有超级接口:
ConfigurableWebServerFactory,ErrorPageRegistry,ServletWebServerFactory,WebListenerRegistry,WebServerFactory
- 所有已知实现类:
AbstractServletWebServerFactory,JettyServletWebServerFactory,TomcatServletWebServerFactory,UndertowServletWebServerFactory
public interface ConfigurableServletWebServerFactory
extends ConfigurableWebServerFactory, ServletWebServerFactory, WebListenerRegistry
A configurable
ServletWebServerFactory.- 从以下版本开始:
- 2.0.0
- 作者:
- Dave Syer, Andy Wilkinson, Stephane Nicoll, Eddú Meléndez, Brian Clozel
- 另请参阅:
-
方法概要
修饰符和类型方法说明voidaddCookieSameSiteSuppliers(CookieSameSiteSupplier... cookieSameSiteSuppliers) AddCookieSameSiteSuppliersto those that should be used to obtain theCookie.SameSiteattribute of any added cookie.voidaddInitializers(ServletContextInitializer... initializers) AddServletContextInitializers to those that should be applied in addition toServletWebServerFactory.getWebServer(ServletContextInitializer...)parameters.voidaddMimeMappings(MimeMappings mimeMappings) Adds mime-type mappings.voidsetContextPath(String contextPath) Sets the context path for the web server.voidsetCookieSameSiteSuppliers(List<? extends CookieSameSiteSupplier> cookieSameSiteSuppliers) SetsCookieSameSiteSuppliersthat should be used to obtain theCookie.SameSiteattribute of any added cookie.voidsetDisplayName(String displayName) Sets the display name of the application deployed in the web server.voidsetDocumentRoot(File documentRoot) Sets the document root directory which will be used by the web context to serve static files.voidsetInitializers(List<? extends ServletContextInitializer> initializers) SetsServletContextInitializerthat should be applied in addition toServletWebServerFactory.getWebServer(ServletContextInitializer...)parameters.voidsetInitParameters(Map<String, String> initParameters) Sets the init parameters that are applied to the container'sServletContext.voidSets the configuration that will be applied to the server's JSP servlet.voidsetLocaleCharsetMappings(Map<Locale, Charset> localeCharsetMappings) Sets the Locale to Charset mappings.voidsetMimeMappings(MimeMappings mimeMappings) Sets the mime-type mappings.voidsetRegisterDefaultServlet(boolean registerDefaultServlet) Set if the DefaultServlet should be registered.voidsetSession(Session session) Sets the configuration that will be applied to the container's HTTP session support.从接口继承的方法 org.springframework.boot.web.server.ConfigurableWebServerFactory
setAddress, setCompression, setErrorPages, setHttp2, setPort, setServerHeader, setShutdown, setSsl, setSslBundles从接口继承的方法 org.springframework.boot.web.server.ErrorPageRegistry
addErrorPages从接口继承的方法 org.springframework.boot.web.servlet.server.ServletWebServerFactory
getWebServer从接口继承的方法 org.springframework.boot.web.servlet.WebListenerRegistry
addWebListeners
-
方法详细资料
-
setContextPath
Sets the context path for the web server. The context should start with a "/" character but not end with a "/" character. The default context path can be specified using an empty string.- 参数:
contextPath- the contextPath to set
-
setDisplayName
Sets the display name of the application deployed in the web server.- 参数:
displayName- the displayName to set- 从以下版本开始:
- 1.3.0
-
setSession
Sets the configuration that will be applied to the container's HTTP session support.- 参数:
session- the session configuration
-
setRegisterDefaultServlet
void setRegisterDefaultServlet(boolean registerDefaultServlet) Set if the DefaultServlet should be registered. Defaults tofalsesince 2.4.- 参数:
registerDefaultServlet- if the default servlet should be registered
-
setMimeMappings
Sets the mime-type mappings.- 参数:
mimeMappings- the mime type mappings (defaults toMimeMappings.DEFAULT)
-
addMimeMappings
Adds mime-type mappings.- 参数:
mimeMappings- the mime type mappings to add- 从以下版本开始:
- 3.3.0
-
setDocumentRoot
Sets the document root directory which will be used by the web context to serve static files.- 参数:
documentRoot- the document root ornullif not required
-
setInitializers
SetsServletContextInitializerthat should be applied in addition toServletWebServerFactory.getWebServer(ServletContextInitializer...)parameters. This method will replace any previously set or added initializers.- 参数:
initializers- the initializers to set- 另请参阅:
-
addInitializers
AddServletContextInitializers to those that should be applied in addition toServletWebServerFactory.getWebServer(ServletContextInitializer...)parameters.- 参数:
initializers- the initializers to add- 另请参阅:
-
setJsp
Sets the configuration that will be applied to the server's JSP servlet.- 参数:
jsp- the JSP servlet configuration
-
setLocaleCharsetMappings
Sets the Locale to Charset mappings.- 参数:
localeCharsetMappings- the Locale to Charset mappings
-
setInitParameters
Sets the init parameters that are applied to the container'sServletContext.- 参数:
initParameters- the init parameters
-
setCookieSameSiteSuppliers
SetsCookieSameSiteSuppliersthat should be used to obtain theCookie.SameSiteattribute of any added cookie. This method will replace any previously set or added suppliers.- 参数:
cookieSameSiteSuppliers- the suppliers to add- 另请参阅:
-
addCookieSameSiteSuppliers
AddCookieSameSiteSuppliersto those that should be used to obtain theCookie.SameSiteattribute of any added cookie.- 参数:
cookieSameSiteSuppliers- the suppliers to add- 另请参阅:
-