web123456

How to Create a SpringBoot Project in IDEA

Article Catalog

  • 1. Create and add references
    • 1.1 Open IDEA and create a new project.
    • 1.2 Installing plug-ins and adding references
    • 1.3 Wait for the project to finish loading
  • 2. Add code to run the program
    • 2.1 Introduction to the catalog
    • 2.2 Adding control classes to the project
    • 2.3 Code Run
  • 3. Browser access

1. Create and add references

1.1 Open IDEA and create a new project.

在这里插入图片描述

1.2 Installing plug-ins and adding references

Find SpringAssistant on the left side and click on it; if you don't have SpringAssistant, you need to download the plug-in.
Download the plugin in Settings:
在这里插入图片描述
Download successfully and create a new project:
在这里插入图片描述
在这里插入图片描述
ps: The general modification is the Java version.

Install the plug-in SpringAssistant:

在这里插入图片描述
Add the reference this way when you create a new project, and then add the reference again when you want to maintain the project later, as follows:
Install the plug-in EditStarters:
在这里插入图片描述
Right-click and select Generate:
在这里插入图片描述
Select the plugin you just downloaded:
在这里插入图片描述
Click OK;
在这里插入图片描述
This eliminates the need to look for references from a centralized repository and note the version number that matches the project and download it, as you would have to do to create a Servlet.

1.3 Wait for the project to finish loading

在这里插入图片描述
ps: Insert the completed orange label to blue label.

2. Add code to run the program

2.1 Introduction to the catalog

在这里插入图片描述

2.2 Adding control classes to the project

在这里插入图片描述
ps: 1. Note that the class is added in the java folder in the main directory, not in the java folder in the test directory. The visual difference between the two is that the correct icon should be blue.
2. One of the features of the SpringBoot project is that a class can have multiple url addresses, while the Servlet project can only contain one url in a class.

2.3 Code Run

Find the startup class DemoApplication, in the Java directory, intuitive identification is the blue label with a small green arrow, click Run, the following interface appears to start successfully.
在这里插入图片描述
ps: SpingBoot runtime compared to Servlet is more convenient, no need to configure Tomcat; deployment projects also do not need to configure Tomcat.

3. Browser access

IP plus port number plus url address for direct access.
在这里插入图片描述
It can also be followed by a parameter.
在这里插入图片描述