类 AbstractServletWebServerFactory
java.lang.Object
org.springframework.boot.web.server.AbstractConfigurableWebServerFactory
org.springframework.boot.web.servlet.server.AbstractServletWebServerFactory
- 所有已实现的接口:
ConfigurableWebServerFactory,ErrorPageRegistry,WebServerFactory,ConfigurableServletWebServerFactory,ServletWebServerFactory,WebListenerRegistry
- 直接已知子类:
JettyServletWebServerFactory,TomcatServletWebServerFactory,UndertowServletWebServerFactory
public abstract class AbstractServletWebServerFactory
extends AbstractConfigurableWebServerFactory
implements ConfigurableServletWebServerFactory
Abstract base class for
ConfigurableServletWebServerFactory implementations.- 从以下版本开始:
- 2.0.0
- 作者:
- Phillip Webb, Dave Syer, Andy Wilkinson, Stephane Nicoll, Ivan Sopov, Eddú Meléndez, Brian Clozel
-
字段概要
字段 -
构造器概要
构造器构造器说明Create a newAbstractServletWebServerFactoryinstance.AbstractServletWebServerFactory(int port) Create a newAbstractServletWebServerFactoryinstance with the specified port.AbstractServletWebServerFactory(String contextPath, int port) Create a newAbstractServletWebServerFactoryinstance with the specified context path and port. -
方法概要
修饰符和类型方法说明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.voidaddWebListeners(String... webListenerClassNames) Adds web listeners that will be registered with the servlet container.Returns the context path for the web server.Returns the document root which will be used by the web context to serve static files.getJsp()Return the Locale to Charset mappings.Returns the mime-type mappings.protected final FileReturns the absolute document root when it points to a valid directory, logging a warning and returningnullotherwise.protected final Fileprotected final FilegetValidSessionStoreDir(boolean mkdirs) booleanFlag to indicate that the default servlet should be registered.protected final ServletContextInitializer[]mergeInitializers(ServletContextInitializer... initializers) Utility method that can be used by subclasses wishing to combine the specifiedServletContextInitializerparameters with those defined in this instance.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.protected booleanReturns whether the JSP servlet should be registered with the web server.从类继承的方法 org.springframework.boot.web.server.AbstractConfigurableWebServerFactory
addErrorPages, createTempDir, getAddress, getCompression, getErrorPages, getHttp2, getPort, getServerHeader, getServerNameSslBundles, getShutdown, getSsl, getSslBundle, getSslBundles, setAddress, setCompression, setErrorPages, setHttp2, setPort, setServerHeader, setShutdown, setSsl, setSslBundles从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 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
-
字段详细资料
-
logger
-
-
构造器详细资料
-
AbstractServletWebServerFactory
public AbstractServletWebServerFactory()Create a newAbstractServletWebServerFactoryinstance. -
AbstractServletWebServerFactory
public AbstractServletWebServerFactory(int port) Create a newAbstractServletWebServerFactoryinstance with the specified port.- 参数:
port- the port number for the web server
-
AbstractServletWebServerFactory
Create a newAbstractServletWebServerFactoryinstance with the specified context path and port.- 参数:
contextPath- the context path for the web serverport- the port number for the web server
-
-
方法详细资料
-
getContextPath
Returns the context path for the web server. The path will start with "/" and not end with "/". The root context is represented by an empty string.- 返回:
- the context path
-
setContextPath
从接口复制的说明:ConfigurableServletWebServerFactorySets 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.- 指定者:
setContextPath在接口中ConfigurableServletWebServerFactory- 参数:
contextPath- the contextPath to set
-
getDisplayName
-
setDisplayName
从接口复制的说明:ConfigurableServletWebServerFactorySets the display name of the application deployed in the web server.- 指定者:
setDisplayName在接口中ConfigurableServletWebServerFactory- 参数:
displayName- the displayName to set
-
isRegisterDefaultServlet
public boolean isRegisterDefaultServlet()Flag to indicate that the default servlet should be registered.- 返回:
- true if the default servlet is to be registered
-
setRegisterDefaultServlet
public void setRegisterDefaultServlet(boolean registerDefaultServlet) 从接口复制的说明:ConfigurableServletWebServerFactorySet if the DefaultServlet should be registered. Defaults tofalsesince 2.4.- 指定者:
setRegisterDefaultServlet在接口中ConfigurableServletWebServerFactory- 参数:
registerDefaultServlet- if the default servlet should be registered
-
getMimeMappings
Returns the mime-type mappings.- 返回:
- the mimeMappings the mime-type mappings.
-
setMimeMappings
从接口复制的说明:ConfigurableServletWebServerFactorySets the mime-type mappings.- 指定者:
setMimeMappings在接口中ConfigurableServletWebServerFactory- 参数:
mimeMappings- the mime type mappings (defaults toMimeMappings.DEFAULT)
-
addMimeMappings
从接口复制的说明:ConfigurableServletWebServerFactoryAdds mime-type mappings.- 指定者:
addMimeMappings在接口中ConfigurableServletWebServerFactory- 参数:
mimeMappings- the mime type mappings to add
-
getDocumentRoot
Returns the document root which will be used by the web context to serve static files.- 返回:
- the document root
-
setDocumentRoot
从接口复制的说明:ConfigurableServletWebServerFactorySets the document root directory which will be used by the web context to serve static files.- 指定者:
setDocumentRoot在接口中ConfigurableServletWebServerFactory- 参数:
documentRoot- the document root ornullif not required
-
setInitializers
从接口复制的说明:ConfigurableServletWebServerFactorySetsServletContextInitializerthat should be applied in addition toServletWebServerFactory.getWebServer(ServletContextInitializer...)parameters. This method will replace any previously set or added initializers.- 指定者:
setInitializers在接口中ConfigurableServletWebServerFactory- 参数:
initializers- the initializers to set- 另请参阅:
-
addInitializers
从接口复制的说明:ConfigurableServletWebServerFactoryAddServletContextInitializers to those that should be applied in addition toServletWebServerFactory.getWebServer(ServletContextInitializer...)parameters.- 指定者:
addInitializers在接口中ConfigurableServletWebServerFactory- 参数:
initializers- the initializers to add- 另请参阅:
-
getJsp
-
setJsp
从接口复制的说明:ConfigurableServletWebServerFactorySets the configuration that will be applied to the server's JSP servlet.- 指定者:
setJsp在接口中ConfigurableServletWebServerFactory- 参数:
jsp- the JSP servlet configuration
-
getSession
-
setSession
从接口复制的说明:ConfigurableServletWebServerFactorySets the configuration that will be applied to the container's HTTP session support.- 指定者:
setSession在接口中ConfigurableServletWebServerFactory- 参数:
session- the session configuration
-
getLocaleCharsetMappings
Return the Locale to Charset mappings.- 返回:
- the charset mappings
-
setLocaleCharsetMappings
从接口复制的说明:ConfigurableServletWebServerFactorySets the Locale to Charset mappings.- 指定者:
setLocaleCharsetMappings在接口中ConfigurableServletWebServerFactory- 参数:
localeCharsetMappings- the Locale to Charset mappings
-
setInitParameters
从接口复制的说明:ConfigurableServletWebServerFactorySets the init parameters that are applied to the container'sServletContext.- 指定者:
setInitParameters在接口中ConfigurableServletWebServerFactory- 参数:
initParameters- the init parameters
-
getInitParameters
-
setCookieSameSiteSuppliers
public void setCookieSameSiteSuppliers(List<? extends CookieSameSiteSupplier> cookieSameSiteSuppliers) 从接口复制的说明:ConfigurableServletWebServerFactorySetsCookieSameSiteSuppliersthat should be used to obtain theCookie.SameSiteattribute of any added cookie. This method will replace any previously set or added suppliers.- 指定者:
setCookieSameSiteSuppliers在接口中ConfigurableServletWebServerFactory- 参数:
cookieSameSiteSuppliers- the suppliers to add- 另请参阅:
-
addCookieSameSiteSuppliers
从接口复制的说明:ConfigurableServletWebServerFactoryAddCookieSameSiteSuppliersto those that should be used to obtain theCookie.SameSiteattribute of any added cookie.- 指定者:
addCookieSameSiteSuppliers在接口中ConfigurableServletWebServerFactory- 参数:
cookieSameSiteSuppliers- the suppliers to add- 另请参阅:
-
getCookieSameSiteSuppliers
-
mergeInitializers
protected final ServletContextInitializer[] mergeInitializers(ServletContextInitializer... initializers) Utility method that can be used by subclasses wishing to combine the specifiedServletContextInitializerparameters with those defined in this instance.- 参数:
initializers- the initializers to merge- 返回:
- a complete set of merged initializers (with the specified parameters appearing first)
-
shouldRegisterJspServlet
protected boolean shouldRegisterJspServlet()Returns whether the JSP servlet should be registered with the web server.- 返回:
trueif the servlet should be registered, otherwisefalse
-
getValidDocumentRoot
Returns the absolute document root when it points to a valid directory, logging a warning and returningnullotherwise.- 返回:
- the valid document root
-
getUrlsOfJarsWithMetaInfResources
-
getValidSessionStoreDir
-
getValidSessionStoreDir
-
addWebListeners
从接口复制的说明:WebListenerRegistryAdds web listeners that will be registered with the servlet container.- 指定者:
addWebListeners在接口中WebListenerRegistry- 参数:
webListenerClassNames- the class names of the web listeners
-
getWebListenerClassNames
-