0
点赞
收藏
分享

微信扫一扫

springboot入门篇 hello word程序员 详细步骤

沐之轻语 2022-01-08 阅读 57
spring boot

 

 

这里只需要选择一个web就好了

 

 

 

 

 

 这地方一定要注意 一定要把包新建到com.example下面和Demo01Application同级

 

 进入到Demo01Application项目主入口来运行

 在浏览器输入http://localhost:8080/hello就可以看到hello word了

项目代码

package com.example.controller;

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

@RestController
public class TestController {
    @RequestMapping("/hello")
    public String hello(){
        return "hello word";
    }
}
举报

相关推荐

0 条评论