接收参数有三个方法. 1.接收id的方法: @RestController public class ControllerTest { //在这里读取配置文件 @Autowired private Testconfig testconfig; //访问路径:http://localhost:8080/hello/5 @GetMapping(value = "/hello/{id}") public String hello(@PathVariable("id") I
都是以前的笔记了,有时间就整理出来了,SpringBoot接收前端参数的三种方法,首先第一种代码: @RestController public class ControllerTest { //访问路径:http://localhost:8080/hello/5 @GetMapping(value = "/hello/{id}") public String hello(@PathVariable("id") Integer id){ return "I