Interface ConfigurableServletWebServerFactory

All Superinterfaces:
ConfigurableWebServerFactory, ErrorPageRegistry, ServletWebServerFactory, WebListenerRegistry, WebServerFactory
All Known Implementing Classes:
JettyServletWebServerFactory, TomcatServletWebServerFactory

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 Details

    • getSettings

    • setContextPath

      default 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.
      Parameters:
      contextPath - the context path to set
    • getContextPath

      default String getContextPath()
      Returns the context path for the servlet web server.
      Returns:
      the context path
    • setDisplayName

      default void setDisplayName(String displayName)
      Sets the display name of the application deployed in the web server.
      Parameters:
      displayName - the displayName to set
    • setSession

      default void setSession(Session session)
      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 to false since 2.4.
      Parameters:
      registerDefaultServlet - if the default servlet should be registered
    • setMimeMappings

      default void setMimeMappings(MimeMappings mimeMappings)
      Sets the mime-type mappings.
      Parameters:
      mimeMappings - the mime type mappings (defaults to MimeMappings.DEFAULT)
    • addMimeMappings

      default void addMimeMappings(MimeMappings mimeMappings)
      Adds mime-type mappings.
      Parameters:
      mimeMappings - the mime type mappings to add
    • setDocumentRoot

      default void setDocumentRoot(@Nullable File documentRoot)
      Sets the document root directory which will be used by the web context to serve static files.
      Parameters:
      documentRoot - the document root or null if not required
    • setInitializers

      default void setInitializers(List<? extends ServletContextInitializer> initializers)
      Sets ServletContextInitializer that should be applied in addition to ServletWebServerFactory.getWebServer(ServletContextInitializer...) parameters. This method will replace any previously set or added initializers.
      Parameters:
      initializers - the initializers to set
      See Also:
    • addInitializers

      default void addInitializers(ServletContextInitializer... initializers)
      Add ServletContextInitializers to those that should be applied in addition to ServletWebServerFactory.getWebServer(ServletContextInitializer...) parameters.
      Parameters:
      initializers - the initializers to add
      See Also:
    • setJsp

      default void setJsp(Jsp jsp)
      Sets the configuration that will be applied to the server's JSP servlet.
      Parameters:
      jsp - the JSP servlet configuration
    • setLocaleCharsetMappings

      default void setLocaleCharsetMappings(Map<Locale,Charset> localeCharsetMappings)
      Sets the Locale to Charset mappings.
      Parameters:
      localeCharsetMappings - the Locale to Charset mappings
    • setInitParameters

      default void setInitParameters(Map<String,String> initParameters)
      Sets the init parameters that are applied to the container's ServletContext.
      Parameters:
      initParameters - the init parameters
    • setCookieSameSiteSuppliers

      default void setCookieSameSiteSuppliers(List<? extends CookieSameSiteSupplier> cookieSameSiteSuppliers)
      Sets CookieSameSiteSuppliers that should be used to obtain the Cookie.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

      default void addCookieSameSiteSuppliers(CookieSameSiteSupplier... cookieSameSiteSuppliers)
      Add CookieSameSiteSuppliers to those that should be used to obtain the Cookie.SameSite attribute of any added cookie.
      Parameters:
      cookieSameSiteSuppliers - the suppliers to add
      See Also:
    • addWebListeners

      default void addWebListeners(String... webListenerClassNames)
      Description copied from interface: WebListenerRegistry
      Adds web listeners that will be registered with the servlet web server.
      Specified by:
      addWebListeners in interface WebListenerRegistry
      Parameters:
      webListenerClassNames - the class names of the web listeners