接口 ConfigurableEmbeddedServletContainer
- 所有超级接口:
ErrorPageRegistry
- 所有已知实现类:
AbstractConfigurableEmbeddedServletContainer
,AbstractEmbeddedServletContainerFactory
,JettyEmbeddedServletContainerFactory
,TomcatEmbeddedServletContainerFactory
,UndertowEmbeddedServletContainerFactory
public interface ConfigurableEmbeddedServletContainer extends ErrorPageRegistry
Simple interface that represents customizations to anEmbeddedServletContainerFactory
.
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 void
addInitializers(ServletContextInitializer... initializers)
AddServletContextInitializer
s to those that should be applied in addition toEmbeddedServletContainerFactory.getEmbeddedServletContainer(ServletContextInitializer...)
parameters.void
setAddress(InetAddress address)
Sets the specific network address that the server should bind to.void
setCompression(Compression compression)
Sets the compression configuration that will be applied to the container's default connector.void
setContextPath(String contextPath)
Sets the context path for the embedded servlet container.void
setDisplayName(String displayName)
Sets the display name of the application deployed in the embedded servlet container.void
setDocumentRoot(File documentRoot)
Sets the document root directory which will be used by the web context to serve static files.void
setErrorPages(Set<? extends ErrorPage> errorPages)
Sets the error pages that will be used when handling exceptions.void
setInitializers(List<? extends ServletContextInitializer> initializers)
SetsServletContextInitializer
that should be applied in addition toEmbeddedServletContainerFactory.getEmbeddedServletContainer(ServletContextInitializer...)
parameters.void
setJspServlet(JspServlet jspServlet)
Sets the configuration that will be applied to the container'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
setPersistSession(boolean persistSession)
Sets if session data should be persisted between restarts.void
setPort(int port)
Sets the port that the embedded servlet container should listen on.void
setRegisterDefaultServlet(boolean registerDefaultServlet)
Set if the DefaultServlet should be registered.void
setServerHeader(String serverHeader)
Sets the server header value.void
setSessionStoreDir(File sessionStoreDir)
Set the directory used to store serialized session data.void
setSessionTimeout(int sessionTimeout)
The session timeout in seconds (default 30 minutes).void
setSessionTimeout(int sessionTimeout, TimeUnit timeUnit)
The session timeout in the specifiedTimeUnit
(default 30 minutes).void
setSsl(Ssl ssl)
Sets the SSL configuration that will be applied to the container's default connector.void
setSslStoreProvider(SslStoreProvider sslStoreProvider)
Sets a provider that will be used to obtain SSL stores.从接口继承的方法 org.springframework.boot.web.servlet.ErrorPageRegistry
addErrorPages
方法详细资料
setContextPath
void setContextPath(String contextPath)
Sets the context path for the embedded servlet container. 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 embedded servlet container.- 参数:
displayName
- the displayName to set- 从以下版本开始:
- 1.3.0
setPort
void setPort(int port)
Sets the port that the embedded servlet container should listen on. If not specified port '8080' will be used. Use port -1 to disable auto-start (i.e start the web application context but not have it listen to any port).- 参数:
port
- the port to set
setSessionTimeout
void setSessionTimeout(int sessionTimeout)
The session timeout in seconds (default 30 minutes). If 0 or negative then sessions never expire.- 参数:
sessionTimeout
- the session timeout
setSessionTimeout
void setSessionTimeout(int sessionTimeout, TimeUnit timeUnit)
The session timeout in the specifiedTimeUnit
(default 30 minutes). If 0 or negative then sessions never expire.- 参数:
sessionTimeout
- the session timeouttimeUnit
- the time unit
setPersistSession
void setPersistSession(boolean persistSession)
Sets if session data should be persisted between restarts.- 参数:
persistSession
-true
if session data should be persisted
setSessionStoreDir
void setSessionStoreDir(File sessionStoreDir)
Set the directory used to store serialized session data.- 参数:
sessionStoreDir
- the directory ornull
to use a default location.
setAddress
void setAddress(InetAddress address)
Sets the specific network address that the server should bind to.- 参数:
address
- the address to set (defaults tonull
)
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
setErrorPages
void setErrorPages(Set<? extends ErrorPage> errorPages)
Sets the error pages that will be used when handling exceptions.- 参数:
errorPages
- the error pages
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 toEmbeddedServletContainerFactory.getEmbeddedServletContainer(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 toEmbeddedServletContainerFactory.getEmbeddedServletContainer(ServletContextInitializer...)
parameters.- 参数:
initializers
- the initializers to add- 另请参阅:
setInitializers(java.util.List<? extends org.springframework.boot.web.servlet.ServletContextInitializer>)
setSsl
void setSsl(Ssl ssl)
Sets the SSL configuration that will be applied to the container's default connector.- 参数:
ssl
- the SSL configuration
setSslStoreProvider
void setSslStoreProvider(SslStoreProvider sslStoreProvider)
Sets a provider that will be used to obtain SSL stores.- 参数:
sslStoreProvider
- the SSL store provider
setJspServlet
void setJspServlet(JspServlet jspServlet)
Sets the configuration that will be applied to the container's JSP servlet.- 参数:
jspServlet
- the JSP servlet configuration
setCompression
void setCompression(Compression compression)
Sets the compression configuration that will be applied to the container's default connector.- 参数:
compression
- the compression configuration
setServerHeader
void setServerHeader(String serverHeader)
Sets the server header value.- 参数:
serverHeader
- the server header value
setLocaleCharsetMappings
void setLocaleCharsetMappings(Map<Locale,Charset> localeCharsetMappings)
Sets the Locale to Charset mappings.- 参数:
localeCharsetMappings
- the Locale to Charset mappings