Spring Boot is essentially a sub-module of Spring that speeds up development and allows us to create applications quickly. Because it automates a lot of configuration. In other words, it automates 80-85% of the configuration process.
Spring noticed that about 80% of developer are repeating the same configuration over and over, taking longer to configure. It provides automatic configuration to solve all this problem. And the remaining part which is 20%, the developer can configure as per the requirement.
Because all settings are generated and setup automatically, you can concentrate on software development. It generates production-ready apps, and all we have to do is just execute them. We don’t need to perform any setup for this.
When using Spring MVC, ORM, and JPA, a lot of configuration is required, and we were responsible for all of it. This is a time-consuming process as well. It provides very simple and quick methods for configuring and accomplishing this.
Table of Contents
What does Spring Boot do for a developer?
- Spring Boot comes with a built-in embedded server and the Spring Framework. It will also setup it internally automatically.
- It has said that if you follow a convention, It will be setup for you automatically.
- Spring Boot saves time and effort for developers when it comes to configuration and setup.
- It looks for dependencies in the class path and then configures them.
- It comes with a number of features by default. If you wish, you can use it or alter it.
Advantages of Spring Boot
- It generates a self-contained Spring application that can be launched with just a java-jar.
- Spring Boot comes with a built-in web server, such as Tomcat, Jetty, or Undertow. It is not necessary to use the war file for this.
- It comes with a set of default ‘starter’ dependencies that make the build setup easier for the developer.
- When feasible, it configures Spring and third-party libraries automatically.
- It comes with a number of extra features, such as project health checks and metrics.
To create a application, you’ll need to be familiar with the following technologies.
- Java 1.8 or Java 1.8+
- Maven or Gradle
- Spring Framework
Spring Boot Application Configuration
In application.properties or application.yml, Spring Boot allows us to specify the configuration for the entire project.
We can place the application.properties or application.yml files anywhere in the class path of the application.
Use of application.yml file
We can use the application.yml file to alter the default Tomcat port number, pass configuration, logging level information, and other database-related settings.
In spring boot, what is the default Tomcat port?
Tomcat’s default port is 8080. The server.port property in the application.property file can be modified to modify this.
Is it possible to turn off the default web server in a spring boot application?
Yes, we can configure the web application type using application.properties.
In conclusion, I hope you enjoyed learning about Spring Boot, why we should use it, and how it may assist a software developer.