Spring boot Flashcards
What is the primary purpose of Spring Boot?
Simplified Spring application setup.
(Exp.: While Spring Boot can be used in various contexts like microservice development, its chief aim is to streamline the configuration and deployment of Spring applications.)
Which embedded server does Spring Boot provide by default for web applications?
Apache Tomcat
(Exp.: Spring Boot offers an embedded Apache Tomcat server out of the box, allowing web applications to be easily run without external server setups.)
What role do “starters” play in Spring Boot?
They provide a set of default dependencies for specific tasks.
Which file format cannot be used to configure properties in Spring Boot?
.json
Which annotation activates Spring Boot’s auto-configuration?
@SpringBootApplication
(Exp.: The @SpringBootApplication annotation encompasses several annotations, including @EnableAutoConfiguration, which activates Spring Boot’s auto-configuration feature.)
How does Spring Boot decide whether to autoconfigure a specific feature?
Based on classes available in the classpath
What does Actuator in Spring Boot provide?
Production-ready features like health checks and metrics
To externalize Spring Boot’s configuration, where can properties be specified?
application.properties
What is the purpose of spring-boot-starter-parent?
It provides useful Maven defaults.
How can you specify a specific port number for your Spring Boot application?
By adding server.port= in the application.properties file
What is the primary advantage of using Spring Boot?
Rapid Development
How does Spring Boot simplify database configurations?
By using conventions for data source URLs and drivers
(Exp.: Spring Boot uses convention over configuration, which means it provides sensible defaults (e.g., default data source URLs and drivers) but allows them to be overridden if needed.)
Which of these is a benefit of using Spring Boot?
Reduces boilerplate code
What is the primary purpose of @SpringBootApplication annotation?
A combination of component scanning, autoconfiguration, and Spring Boot’s configuration.
(Exp.: @SpringBootApplication is a convenience annotation that includes @Configuration, @EnableAutoConfiguration, and @ComponentScan.)
Which annotation is specifically used to indicate that a class provides Bean definitions?
@Configuration