Springboot的第一个Web项目

mac2025-03-30  5

首先通过IDEA创建springboot项目选择web模块,或者通过https://start.spring.io/ 去构建web项目, 这样就构建成功了:

创建HelloController package com.zcw.zcw_springboot.zcw_springboot.controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; /** * @author zhaocunwei * @ClassName: HelloController * @Description: TODO * @date 2019/11/1 10:57 */ @RestController public class HelloController { @GetMapping("/hello") public String hello(){ return "hello,demo "; } }

测试

最新回复(0)