Introduction:
Spring Boot is a new framework provided by the Pivotal team. It is designed to simplify the initial construction and development process of new Spring applications. The framework uses a specific way to configure it, so that developers no longer need to define boilerplate configurations. To understand it in my words, spring boot is actually not a new framework. It configures many frameworks to be used by default, just like maven integrates all jar packages, and spring boot integrates all frameworks (I don’t know if this metaphor is suitable).
advantage:
In fact, it is simple, fast and convenient! What do we need to do if we need to build a spring web project?
1) Configure web.xml, load spring and spring mvc
2) Configure database connections and spring transactions
3) Configure the reading of load configuration files and enable annotations
4) Configure log files
Deploy tomcat debugging after configuration is completed
Microservices are very popular now. If my project just needs to send an email, if my project just produces a point, I need to toss it like this!
But what if you use spring boot?
It's very simple. I only need a few configurations to quickly and easily build a set of web projects or build a microservice!
Quick Start
Tools: Intellij idea and maven build projects. How to install and configure maven will not be superfluous here, so I will use Baidu. Idea needs to download the enterprise version, but the community version does not support spring boot. The enterprise version can be tried for 30 days. If you have a student email, you can use it for free.
1. Select File=>New=>Project.. in the menu bar, and we can see the creation function window shown in the figure below. The address pointed to by Initial Service Url is the Spring Initializr tool address provided by Spring official, so the project created here is actually implemented based on its web tools.
2. Click Next, and after waiting for a while, we can see the project information window shown in the figure below, where we can edit the project information we want to create. Among them, Type can change the type of project we want to build, such as: Maven, Gradle; Language can be selected: Java, Groovy, Kotlin.
3. Click Next to enter the window to select Spring Boot version and dependency management. What we are concerned about here is that it not only contains various dependencies in Spring Boot Starter POMs, but also various dependencies in Spring Cloud. Here we choose web, and you can also choose mybatis.
4. Click Next to enter the final details about the engineering physical storage. Finally, click Finish to complete the construction of the project.
One is the spring boot web program and it is completed. Although Spring Initializr in Intellij is still based on the official web implementation, it calls through tools and directly builds the results into our local file system, making the entire construction process smoother. Spring Boot/Cloud enthusiasts who have not experienced this function may wish to try this different construction method.
Summarize
The above is the spring boot study notes (introduction) introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to everyone in time. Thank you very much for your support to Wulin.com website!