1.

What is the importance of @SpringBootApplication?

Answer»

Many Spring BOOT DEVELOPERS LIKE their apps to use auto-configuration, scan components and define the additional configuration in their "app CLASS." A single @SpringBootApplication annotation can be used to enable these three functions, i.e.

  • @EnableAutoConfiguration: Enable the auto-configuration mechanism of Spring Boot
  • @ComponentScan: Enable @Component scan in the package where the application is located (see best practices)
  • @Configuration: Enable the registration of additional beans in the context or import additional configuration classes.


Discussion

No Comment Found