SpringBoot Controller层接收参数的形式
1.参数存在于请求路径中
1.请求的参数:http://localhost:8080/postman/123
123作为参数传递到后台,接收方法:使用@PathVariable注解
@PathVariable是spring3.0的一个新功能:接收请求路径中占位符的值
@RestController
@RequestMapping("postman")
public class controllerTest {
/*
localhost:8080/postman/***
原创
2020-10-23 15:37:43 ·
406 阅读 ·
1 评论