Spring Boot Flashcards
1
Q
What are some important features of using spring boot?
A
- Starter dependency: this feature aggregates common dependencies together.
- Auto-configuration
- Spring initializer: project setup
- Spring actuator: insights of a running spring boot application. Find out which beans are created in Springs app context and which request path are mapped to controllers
- spring CLI
2
Q
What is auto-configuration in spring boot?
A
configures a lot of things based upon what is present in the classpath
- its disabled by default, you need to use either @SpringBootApplication or @EnableAutoConfiguration
3
Q
What is the difference between @SpringBootApplication and @EnableAutoConfiguration?
A
@EnableAutoConfiguration is used to enable auto-configuration but @SpringBootApplication does a lot more than that, it also combines @Configuration(declared one or more bean methods and may be processed by spring container) and @ComponentScan
4
Q
Where do you define properties in Spring Boot application?
A
you can define both application and spring boot related properties into a file called application.properties