Home >Java >javaTutorial >What is the SpringBoot framework and how to use it

What is the SpringBoot framework and how to use it

王林
王林forward
2023-05-18 11:31:062025browse

1. What is SpringBoot?

SpringBoot 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 an ad hoc approach to configuration, eliminating the need for developers to define boilerplate configurations. In this way, Spring Boot strives to become a leader in the booming field of rapid application development. It is a new framework provided by the Pivotal team and is designed to simplify the initial construction and development process of new Spring applications. The framework uses an ad hoc approach to configuration, eliminating the need for developers to define boilerplate configurations. In this way, Spring Boot strives to become a leader in the booming field of rapid application development.

2. Introduction to request and response

What is the SpringBoot framework and how to use it

##Browser/client->server process;

Request server->Browser process: response.

3.

springBoothelloWorld

(1) Create a maven project and add the pom.xml file

Add parent dependency. After introducing this, there is no need to add version configuration for related introductions. Springboot will automatically select the most appropriate version to add:

<parent>
<groupid>org.springframework.boot</groupid>
<artifactid>spring-boot-starter-parent</artifactid>
<version>2.3.3.RELEASE</version>
<relativepath></relativepath> <!-- lookup parent from repository -->
</parent>
(2) Add jar package dependency:

<dependencies>
<!-- mvc,aop的依赖包 -->
<dependency>
<groupid>org.springframework.boot</groupid>
<artifactid>spring-boot-starter-web</artifactid>
<!-- 由于我们在上面指定了parent,这里就不需要指定版本号 -->
</dependency>
</dependencies>
(3) jdk, encoding description:

<properties>
<project.build.sourceencoding>UTF-8</project.build.sourceencoding>
<project.reporting.outputencoding>UTF- 8</project.reporting.outputencoding>
<java.version>1.7</java.version>
</properties>

The above is the detailed content of What is the SpringBoot framework and how to use it. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete