Springboot study notes - has shown signs & "Hello World"

Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/qq_32360995/article/details/91411220

1, open the URL https://start.spring.io/ , quickly generate springboot entry-level project, save download

2, the use of open springboot IDEA project

Click on "import project"

Unzip the downloaded demo.zip, select pom.xml file, then go up next

3, write Hello World

package com.test.demo;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloWorldController {
  /**
   *@author pxChen
   *@date 2019/6/11 9:22
   */
  @RequestMapping("/test")
  public String test() {
    return "Hello World";
  }

}

4, the web introduced dependence maven

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

<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-tomcat</artifactId>
	<version>2.2.0.BUILD-SNAPSHOT</version>
</dependency>

5, to start running, or debug Jieke RUN, springboot tomcat embedded, it is not necessary to install the configuration tomcat

Run successfully, open the browser address bar enter http: // localhost: 8080 / test

Guess you like

Origin blog.csdn.net/qq_32360995/article/details/91411220
Recommended