SpringMVC RequestMapping for GET parameters

前端 未结 6 2000
执念已碎
执念已碎 2020-12-07 12:21

How to make the RequestMapping to handle GET parameters in the url? For example i have this url

http://localhost:8080/userGrid?_search=false&nd=135197257         


        
6条回答
  •  一向
    一向 (楼主)
    2020-12-07 12:49

    You can add @RequestMapping like so:

    @RequestMapping("/userGrid")
    public @ResponseBody GridModel getUsersForGrid(
       @RequestParam("_search") String search,
       @RequestParam String nd,
       @RequestParam int rows,
       @RequestParam int page,
       @RequestParam String sidx) 
       @RequestParam String sord) {
    

提交回复
热议问题