Interface ConfigurableServletWebServerFactory
- All Superinterfaces:
ConfigurableWebServerFactory
,ErrorPageRegistry
,ServletWebServerFactory
,WebListenerRegistry
,WebServerFactory
- All Known Implementing Classes:
JettyServletWebServerFactory
,TomcatServletWebServerFactory
,UndertowServletWebServerFactory
public interface ConfigurableServletWebServerFactory
extends ConfigurableWebServerFactory, ServletWebServerFactory, WebListenerRegistry
A configurable
ServletWebServerFactory
.- Since:
- 4.0.0
- Author:
- Dave Syer, Andy Wilkinson, Stephane Nicoll, EddĂș MelĂ©ndez, Brian Clozel
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
addCookieSameSiteSuppliers
(CookieSameSiteSupplier... cookieSameSiteSuppliers) AddCookieSameSiteSuppliers
to those that should be used to obtain theCookie.SameSite
attribute of any added cookie.default void
addInitializers
(ServletContextInitializer... initializers) AddServletContextInitializer
s to those that should be applied in addition toServletWebServerFactory.getWebServer(ServletContextInitializer...)
parameters.default void
addMimeMappings
(MimeMappings mimeMappings) Adds mime-type mappings.default void
addWebListeners
(String... webListenerClassNames) Adds web listeners that will be registered with the servlet web server.default String
Returns the context path for the servlet web server.default void
setContextPath
(String contextPath) Sets the context path for the web server.default void
setCookieSameSiteSuppliers
(List<? extends CookieSameSiteSupplier> cookieSameSiteSuppliers) SetsCookieSameSiteSuppliers
that should be used to obtain theCookie.SameSite
attribute of any added cookie.default void
setDisplayName
(String displayName) Sets the display name of the application deployed in the web server.default void
setDocumentRoot
(File documentRoot) Sets the document root directory which will be used by the web context to serve static files.default void
setInitializers
(List<? extends ServletContextInitializer> initializers) SetsServletContextInitializer
that should be applied in addition toServletWebServerFactory.getWebServer(ServletContextInitializer...)
parameters.default void
setInitParameters
(Map<String, String> initParameters) Sets the init parameters that are applied to the container'sServletContext
.default void
Sets the configuration that will be applied to the server's JSP servlet.default void
setLocaleCharsetMappings
(Map<Locale, Charset> localeCharsetMappings) Sets the Locale to Charset mappings.default void
setMimeMappings
(MimeMappings mimeMappings) Sets the mime-type mappings.default void
setRegisterDefaultServlet
(boolean registerDefaultServlet) Set if the DefaultServlet should be registered.default void
setSession
(Session session) Sets the configuration that will be applied to the container's HTTP session support.Methods inherited from interface org.springframework.boot.web.server.ConfigurableWebServerFactory
setAddress, setCompression, setErrorPages, setHttp2, setPort, setServerHeader, setShutdown, setSsl, setSslBundles
Methods inherited from interface org.springframework.boot.web.server.ErrorPageRegistry
addErrorPages
Methods inherited from interface org.springframework.boot.web.server.servlet.ServletWebServerFactory
getWebServer
-
Method Details
-
getSettings
ServletWebServerSettings getSettings() -
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.- Parameters:
contextPath
- the context path to set
-
getContextPath
Returns the context path for the servlet web server.- Returns:
- the context path
-
setDisplayName
Sets the display name of the application deployed in the web server.- Parameters:
displayName
- the displayName to set- Since:
- 4.0.0
-
setSession
Sets the configuration that will be applied to the container's HTTP session support.- Parameters:
session
- the session configuration
-
setRegisterDefaultServlet
default void setRegisterDefaultServlet(boolean registerDefaultServlet) Set if the DefaultServlet should be registered. Defaults tofalse
since 2.4.- Parameters:
registerDefaultServlet
- if the default servlet should be registered
-
setMimeMappings
Sets the mime-type mappings.- Parameters:
mimeMappings
- the mime type mappings (defaults toMimeMappings.DEFAULT
)
-
addMimeMappings
Adds mime-type mappings.- Parameters:
mimeMappings
- the mime type mappings to add- Since:
- 4.0.0
-
setDocumentRoot
Sets the document root directory which will be used by the web context to serve static files.- Parameters:
documentRoot
- the document root ornull
if not required
-
setInitializers
SetsServletContextInitializer
that should be applied in addition toServletWebServerFactory.getWebServer(ServletContextInitializer...)
parameters. This method will replace any previously set or added initializers.- Parameters:
initializers
- the initializers to set- See Also:
-
addInitializers
AddServletContextInitializer
s to those that should be applied in addition toServletWebServerFactory.getWebServer(ServletContextInitializer...)
parameters.- Parameters:
initializers
- the initializers to add- See Also:
-
setJsp
Sets the configuration that will be applied to the server's JSP servlet.- Parameters:
jsp
- the JSP servlet configuration
-
setLocaleCharsetMappings
-
setInitParameters
Sets the init parameters that are applied to the container'sServletContext
.- Parameters:
initParameters
- the init parameters
-
setCookieSameSiteSuppliers
default void setCookieSameSiteSuppliers(List<? extends CookieSameSiteSupplier> cookieSameSiteSuppliers) SetsCookieSameSiteSuppliers
that should be used to obtain theCookie.SameSite
attribute of any added cookie. This method will replace any previously set or added suppliers.- Parameters:
cookieSameSiteSuppliers
- the suppliers to add- See Also:
-
addCookieSameSiteSuppliers
AddCookieSameSiteSuppliers
to those that should be used to obtain theCookie.SameSite
attribute of any added cookie.- Parameters:
cookieSameSiteSuppliers
- the suppliers to add- See Also:
-
addWebListeners
Description copied from interface:WebListenerRegistry
Adds web listeners that will be registered with the servlet web server.- Specified by:
addWebListeners
in interfaceWebListenerRegistry
- Parameters:
webListenerClassNames
- the class names of the web listeners
-