(Choose two.)
Show answerHide answer
Correct answer: A, C The default embedded servlet container can be replaced with Undertow.Spring Boot starts up an embedded servlet container by default.
Explanation
ExplanationSpring Boot fundamentally simplifies Spring MVC application deployment by embedding a servlet container. By default, Spring Boot uses Tomcat as the embedded container, starts it automatically, and allows easy replacement with other containers like Jetty or Undertow by excluding Tomcat and including the desired starter.
A is correct – The default embedded servlet container (Tomcat) can be replaced with Undertow by excluding spring-boot-starter-tomcat and including spring-boot-starter-undertow.
C is correct – Spring Boot starts up an embedded servlet container by default (Tomcat) when spring-boot-starter-web is added. No external server installation is required.
❌ Why other options are incorrect:
B – False. Tomcat is the default servlet container, not Jetty. Jetty can be used but must be explicitly configured.
D – False. The default port of the embedded servlet container is 8080, not 8088. Port 8088 is sometimes used for alternative connectors or management ports but is not the default.
E – False. Spring MVC does not start an in-memory database by default. While Spring Boot auto-configures an in-memory database (like H2) if its driver is on the classpath, Spring MVC itself has no such behavior. This is a separate auto-configuration feature.
📚 References
Spring Boot Reference Documentation – Embedded Servlet Containers:
“Spring Boot includes support for embedded Tomcat, Jetty, and Undertow. By default, Tomcat is used when spring-boot-starter-web is added.”
Spring Boot – Replacing the embedded container:
“To use Undertow instead of Tomcat, exclude spring-boot-starter-tomcat and add spring-boot-starter-undertow.”
