接口 ConfigurableServletWebServerFactory
- 所有已知实现类:
AbstractServletWebServerFactory
,JettyServletWebServerFactory
,TomcatServletWebServerFactory
,UndertowServletWebServerFactory
public interface ConfigurableServletWebServerFactory extends ConfigurableWebServerFactory, ServletWebServerFactory
A configurableServletWebServerFactory
.- 从以下版本开始:
- 2.0.0
- 另请参阅:
ServletWebServerFactory
,WebServerFactoryCustomizer
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 void
addInitializers(ServletContextInitializer... initializers)
AddServletContextInitializer
s to those that should be applied in addition toServletWebServerFactory.getWebServer(ServletContextInitializer...)
parameters.void
setContextPath(String contextPath)
Sets the context path for the web server.void
setDisplayName(String displayName)
Sets the display name of the application deployed in the web server.void
setDocumentRoot(File documentRoot)
Sets the document root directory which will be used by the web context to serve static files.void
setInitializers(List<? extends ServletContextInitializer> initializers)
SetsServletContextInitializer
that should be applied in addition toServletWebServerFactory.getWebServer(ServletContextInitializer...)
parameters.void
setInitParameters(Map<String,String> initParameters)
Sets the init parameters that are applied to the container'sServletContext
.void
setJsp(Jsp jsp)
Sets the configuration that will be applied to the server's JSP servlet.void
setLocaleCharsetMappings(Map<Locale,Charset> localeCharsetMappings)
Sets the Locale to Charset mappings.void
setMimeMappings(MimeMappings mimeMappings)
Sets the mime-type mappings.void
setRegisterDefaultServlet(boolean registerDefaultServlet)
Set if the DefaultServlet should be registered.void
setSession(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, setSsl, setSslStoreProvider
从接口继承的方法 org.springframework.boot.web.server.ErrorPageRegistry
addErrorPages
从接口继承的方法 org.springframework.boot.web.servlet.server.ServletWebServerFactory
getWebServer
方法详细资料
setContextPath
void setContextPath(String contextPath)
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
void setDisplayName(String displayName)
Sets the display name of the application deployed in the web server.- 参数:
displayName
- the displayName to set- 从以下版本开始:
- 1.3.0
setSession
void setSession(Session session)
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 totrue
so that files from thedocument root
will be served.- 参数:
registerDefaultServlet
- if the default servlet should be registered
setMimeMappings
void setMimeMappings(MimeMappings mimeMappings)
Sets the mime-type mappings.- 参数:
mimeMappings
- the mime type mappings (defaults toMimeMappings.DEFAULT
)
setDocumentRoot
void setDocumentRoot(File documentRoot)
Sets the document root directory which will be used by the web context to serve static files.- 参数:
documentRoot
- the document root ornull
if not required
setInitializers
void setInitializers(List<? extends ServletContextInitializer> initializers)
SetsServletContextInitializer
that 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(org.springframework.boot.web.servlet.ServletContextInitializer...)
addInitializers
void addInitializers(ServletContextInitializer... initializers)
AddServletContextInitializer
s to those that should be applied in addition toServletWebServerFactory.getWebServer(ServletContextInitializer...)
parameters.- 参数:
initializers
- the initializers to add- 另请参阅:
setInitializers(java.util.List<? extends org.springframework.boot.web.servlet.ServletContextInitializer>)
setJsp
void setJsp(Jsp jsp)
Sets the configuration that will be applied to the server's JSP servlet.- 参数:
jsp
- the JSP servlet configuration
setLocaleCharsetMappings
void setLocaleCharsetMappings(Map<Locale,Charset> localeCharsetMappings)
Sets the Locale to Charset mappings.- 参数:
localeCharsetMappings
- the Locale to Charset mappings
setInitParameters
void setInitParameters(Map<String,String> initParameters)
Sets the init parameters that are applied to the container'sServletContext
.- 参数:
initParameters
- the init parameters