处理参数缺失: @ExceptionHandler void handleMissingServletRequestParameterException(MissingServletRequestParameterException e, HttpServletResponse response) throws IOException { response.sendError(HttpStatus.BAD_REQUEST.value(), "Check request"); }
参考:
1.http://haohaoxuexi.iteye.com/blog/1188161