xxxxxxxxxx
Spring Boot is an open source Java-based framework used to create a micro Service. It is developed by Pivotal Team and is used to build stand-alone and production ready spring applications.
xxxxxxxxxx
Spring Boot is basically an extension of the Spring framework which eliminated the boilerplate configurations required for setting up a Spring application.
Spring Boot is an opinionated framework that helps developers build Spring-based applications quickly and easily.
The main goal of Spring Boot is to quickly create Spring-based applications without requiring developers to write the same boilerplate configuration again and again.
This is another framework I recommend every Java developer to learn in 2023 and going forward. Spring Boot took Spring’s philosophy of simplification and made it easy to work with Spring itself. Just like Spring makes it easier to create a Java application, Spring Boot makes it easier to create a spring-based Java application.
Features like auto-configuration take away most of the pain associated with configuring the Spring application. Similarly, starter POM features grouped commonly used dependency into simple reusable POMs.
Now, if you want to learn Spring Boot, I strongly suggest you go through Learn Spring Boot in 100 Steps course; it’s one of the best and most up-to-date and also provide step-by-step guides for everyday things a Spring Boot developer needs to know.
xxxxxxxxxx
/*
* The Java code from the project shows how Spring Boot can be used.
*/
@RestController
@SpringBootApplication
public class ControllerAndMain {
@RequestMapping("/") public String hello() {
return "hello\n";
}
public static void main(String[] args) {
SpringApplication.run(ControllerAndMain.class, args);
}
}
xxxxxxxxxx
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}