Spring 5.0.3 RequestRejectedException: The request was rejected because the URL was not normalized

前端 未结 7 590
梦谈多话
梦谈多话 2020-11-27 15:59

Not sure if this is a bug with Spring 5.0.3 or a new feature to fix things on my end.

After the upgrade, I am getting this error. Interestingly this error is only on

7条回答
  •  粉色の甜心
    2020-11-27 16:16

    I encountered the same problem with:

    Spring Boot version = 1.5.10
    Spring Security version = 4.2.4


    The problem occurred on the endpoints, where the ModelAndView viewName was defined with a preceding forward slash. Example:

    ModelAndView mav = new ModelAndView("/your-view-here");
    

    If I removed the slash it worked fine. Example:

    ModelAndView mav = new ModelAndView("your-view-here");
    

    I also did some tests with RedirectView and it seemed to work with a preceding forward slash.

提交回复
热议问题