Bird
0
0

In a Spring Boot app with @SpringBootApplication, what is the effect of having spring-boot-starter-web on the classpath?

medium📝 component behavior Q4 of 15
Spring Boot - Fundamentals
In a Spring Boot app with @SpringBootApplication, what is the effect of having spring-boot-starter-web on the classpath?
AThe app disables web support by default
BSpring Boot auto-configures an embedded web server and MVC components
COnly REST controllers are auto-configured, no server is started
DThe app requires manual configuration of the web server
Step-by-Step Solution
Solution:
  1. Step 1: Recognize spring-boot-starter-web role

    This starter includes dependencies for web applications including embedded servers.
  2. Step 2: Understand auto-configuration behavior

    Spring Boot auto-configures Tomcat (or other embedded server) and MVC when this starter is present.
  3. Final Answer:

    Spring Boot auto-configures an embedded web server and MVC components -> Option B
  4. Quick Check:

    Web starter triggers embedded server auto-config [OK]
Quick Trick: Web starter triggers embedded server auto-config [OK]
Common Mistakes:
  • Assuming web support is disabled by default
  • Thinking manual server config is needed
  • Believing only REST controllers are configured without server

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes