Spring MVC - RequestParamException parameter is not present

前端 未结 3 1937
情话喂你
情话喂你 2021-02-13 11:21

I\'ve got an issue that occurs eventually in my website. It uses AJAX requests to get data from the server, which uses Spring MVC.

What

3条回答
  •  时光说笑
    2021-02-13 11:56

    If you are not been able to figure out what is reason behind missing parameter, so you can add

    public void controllerMethodName (@RequestParam(required = false) int page)
    

    code in your controller definition which will not throw any exception if parameter is not present in your ajax request.

提交回复
热议问题