精选圈子榜单优站
编程综合
编程综合
技术
20关注
编程技术记录、分享 ,记录你的编程生活点点滴滴!

springboot----(有点懒,不更了)


官方教程:Spring Boot

定义模板---下载--解压,导入idea

新建一些类和包,启动spring

src/main/java/com.example.demo下

在DemoController同级目录下建包

controller
dao
pojo
service

编写DemoController

在controller包下新建DemoController类

@RestController
public class HelloController {
@RequestMapping("/hello")
public String hello(){
// 调用业务,接受前端参数
return "Hello,world";
}
}

编译运行

浏览器输入localhost:8080/hello

即可看到  "Hello,world"

--------------------------华丽的分割线--------------------------------



  • 若文章侵犯了您的权益,请联系我们进行处理。

  • 2021-07-03
  • 22072阅读
评论