Intellij IDEA graphic tutorial for creating a spring-boot project,
Development Environment:
- Jdk: jdk 8
- Maven: maven-3.5.2
- Development Tool: Itellij IDEA 2017.1.
Prerequisites: you have installed the above software and configured the jdk and maven environment variables.
Procedure:
Click Upload file --- Select new --- and click project..., as shown in:
Click Spring Initializr --- create jdk in the upper-right corner of Spring Initializr --- click next, as shown in:
View the information in the requirement modification and click next (you can use the default value directly)
Click "Web ---" on the left, select the Web in the middle column, and click "next", as shown in:
Enter the project name and save path --- "and click finish
Shows the created Project:
The code for creating the HelloController class is as follows:
package com.example.demo.controller;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.RestController;@RestController@RequestMapping("/hello")public class HelloController { @RequestMapping("/say") public String sayHello() { return "hello world"; }}
Run the main method in DemoApplication and access the http: // localhost: 8080/hello/say page as follows:
Summary
The above is a graphic tutorial on how Intellij IDEA creates a spring-boot project. I hope it will help you. If you have any questions, please leave a message, the editor will reply to you in time!