我最终得到的最简单,最快的解决方案是执行以下操作:
@ControllerAdvicepublic class ControllerHandler { @ExceptionHandler(MissingServletRequestParameterException.class) public String handleMyException(Exception exception, HttpServletRequest request) { return "/error/myerror"; }}此处的关键是处理org.springframework.web.bind。
MissingServletRequestParameterException ;
其他替代方法,也可以通过web.xml完成,如下所示:
<error-page> <exception-type>org.springframework.web.bind.MissingServletRequestParameterException</exception-type> <location>/WEB-INF/error/myerror.jsp</location></error-page>



