@PathVariable相关注意点

1、使用@PathVariable注解时,说明url路径采用restful风格,即http://localhost:8080/zgbj/1/2

2、@PathVariable注解也可以接受多个参数,例如public ModelAndView configAntennaIndex(@PathVariable String dmmc,@PathVariable String cdh){}

3、不要将restful风格与传统的路径格式混淆;

  像http://localhost:8080/page?page=1&pageSize=10  该参数可以直接在形参中进行接收,只要参数名一样就行。

posted @ 2023-02-23 11:13  先娶国王后取经  阅读(78)  评论(0编辑  收藏  举报