public interface ConfigurableEmbeddedServletContainerFactory extends EmbeddedServletContainerFactory
EmbeddedServletContainerFactory
.EmbeddedServletContainerFactory
Modifier and Type | Method and Description |
---|---|
void |
addErrorPages(ErrorPage... errorPages)
Adds error pages that will be used when handling exceptions.
|
void |
addInitializers(ServletContextInitializer... initializers)
Add
ServletContextInitializer s to those that should be applied in addition
to EmbeddedServletContainerFactory.getEmbeddedServletContainer(ServletContextInitializer...) parameters. |
int |
getPort()
The port that the embedded server listens on.
|
void |
setAddress(InetAddress address)
Sets the specific network address that the server should bind to.
|
void |
setContextPath(String contextPath)
Sets the context path for the embedded servlet container.
|
void |
setDocumentRoot(File documentRoot)
Sets the document root folder which will be used by the web context to serve static
files.
|
void |
setErrorPages(Set<ErrorPage> errorPages)
Sets the error pages that will be used when handling exceptions.
|
void |
setInitializers(List<? extends ServletContextInitializer> initializers)
Sets
ServletContextInitializer that should be applied in addition to
EmbeddedServletContainerFactory.getEmbeddedServletContainer(ServletContextInitializer...) parameters. |
void |
setJspServletClassName(String jspServletClassName)
The class name for the jsp servlet if used.
|
void |
setMimeMappings(MimeMappings mimeMappings)
Sets the mime-type mappings.
|
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 |
setRegisterJspServlet(boolean registerJspServlet)
Set if the JspServlet should be registered if it is on the classpath.
|
void |
setSessionTimeout(int sessionTimeout)
The session timeout in seconds (default 30).
|
void |
setSessionTimeout(int sessionTimeout,
TimeUnit timeUnit)
The session timeout in the specified
TimeUnit (default 30 seconds). |
getEmbeddedServletContainer
void setContextPath(String contextPath)
contextPath
- the contextPath to setvoid setPort(int port)
port
- the port to setint getPort()
void setSessionTimeout(int sessionTimeout)
sessionTimeout
- the session timeoutvoid setSessionTimeout(int sessionTimeout, TimeUnit timeUnit)
TimeUnit
(default 30 seconds). If 0 or
negative then sessions never expire.sessionTimeout
- the session timeouttimeUnit
- the time unitvoid setAddress(InetAddress address)
address
- the address to set (defaults to null
)void setJspServletClassName(String jspServletClassName)
registerJspServlet
is true
and this class is on the classpath then it will be registered. Since both
Tomcat and Jetty use Jasper for their JSP implementation the default is
org.apache.jasper.servlet.JspServlet
.jspServletClassName
- the class name for the JSP servlet if usedvoid setRegisterJspServlet(boolean registerJspServlet)
true
so that files from the document root
will be served.registerJspServlet
- if the JSP servlet should be registeredvoid setRegisterDefaultServlet(boolean registerDefaultServlet)
true
so that
files from the document root
will be served.registerDefaultServlet
- if the default servlet should be registeredvoid addErrorPages(ErrorPage... errorPages)
errorPages
- the error pagesvoid setErrorPages(Set<ErrorPage> errorPages)
errorPages
- the error pagesvoid setMimeMappings(MimeMappings mimeMappings)
mimeMappings
- the mime type mappings (defaults to
MimeMappings.DEFAULT
)void setDocumentRoot(File documentRoot)
documentRoot
- the document root or null
if not requiredvoid setInitializers(List<? extends ServletContextInitializer> initializers)
ServletContextInitializer
that should be applied in addition to
EmbeddedServletContainerFactory.getEmbeddedServletContainer(ServletContextInitializer...)
parameters. This
method will replace any previously set or added initializers.initializers
- the initializers to setaddInitializers(org.springframework.boot.context.embedded.ServletContextInitializer...)
void addInitializers(ServletContextInitializer... initializers)
ServletContextInitializer
s to those that should be applied in addition
to EmbeddedServletContainerFactory.getEmbeddedServletContainer(ServletContextInitializer...)
parameters.initializers
- the initializers to addsetInitializers(java.util.List<? extends org.springframework.boot.context.embedded.ServletContextInitializer>)
Copyright © 2014. All rights reserved.