Idea creates a springboot project

Programmer light 2022-02-13 07:58:53 阅读数:416

idea creates springboot project

One 、 open Idea

 

  Two 、 To configure

  • choice Spring Initializr
  • Fill in your project name
  • Modify your project address
  • choice java8, Use jdk1.8 edition

  next step

  Click on Finish complete

3、 ... and 、 add to SpringMVC Module dependency

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

Four 、 Add project port

application.properties In file :
server.port=8888

  5、 ... and 、 Refresh maven, Actively add dependencies

  6、 ... and 、 add to rest Interface

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class IndexController {
@GetMapping("/index")
public String index(){
return "index";
}
}

7、 ... and 、 Start the project and request the interface

http://localhost:8888/index

 

copyright:author[Programmer light],Please bring the original link to reprint, thank you. https://en.javamana.com/2022/02/202202130758516327.html