Developing Java Applications with Spring and Spring Boot
by Claudio Eduardo de Oliveira, Greg L. Turnquist, Alex Antonov
How it works...
The ServletWebServerFactory interface defines the WebServer getWebServer(ServletContextInitializer... initializers) method. Out of the box, Spring Boot provides concrete factory implementations for the TomcatServletWebServerFactory, JettyServletWebServerFactory, and UndertowServletWebServerFactory application servers. Since we are using Tomcat in our example, we will be using the provided TomcatServletWebServerFactory class to configure the behavior of the session.
During application startup, Spring Boot autoconfiguration detects the presence of the factory and invokes the getWebServer(...) method, passing the reference to a collection of ServletContextInitializer beans. Typically, those initializers are created and managed ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access