01_idea创建springboot

1.new project

2.spring intializr

image-20201109135210982

3.填写组织名称和项目名

image-20201109140251341

4.左边选择web,右边选择springweb

image-20201109140437334

5.指定项目路径后就完成了

image-20201109140555357

6.新建com.example.demo_zhang.web,在其目录下新建类HelloController。

package com.example.demo_zhang.web;

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

@RestController
public class HelloController {

    @RequestMapping("/hello")
    public String hello() {
        return "Hello Spring Boot!";
    }

}

7.启动DemoZhangApplication,然后访问http://127.0.0.1:8080/hello

image-20201109151340306
posted @ 2020-11-19 11:48  脑袋有点大  阅读(70)  评论(0编辑  收藏  举报