美文网首页
如何快速构建spring boot程序

如何快速构建spring boot程序

作者: Kingtester | 来源:发表于2022-02-17 09:17 被阅读0次

1,idea创建项目:


image.png

2,选择模块使用的技术:


image.png
3,编写控制器类:
image.png
//rest模式
@RestController  //rest风格的控制器注解
@RequestMapping("/books")  //请求映射名
public class BookCcontroller {

    @GetMapping  //设置请求方式
    public String getById(){
        System.out.println("你好");
        return "你好";
    }
}

4,启动主程序,访问tomcat端口路径:

image.png

搞定!
rest风格:


image.png

相关文章

网友评论

      本文标题:如何快速构建spring boot程序

      本文链接:https://www.haomeiwen.com/subject/rpbjlrtx.html