spring异常处理@ExceptionHandler

处理参数缺失:

@ExceptionHandler
	void handleMissingServletRequestParameterException(MissingServletRequestParameterException e, HttpServletResponse response) throws IOException {
		response.sendError(HttpStatus.BAD_REQUEST.value(), "Check request");
	}

参考:

1.http://haohaoxuexi.iteye.com/blog/1188161

猜你喜欢

转载自jameskaron.iteye.com/blog/2311071
今日推荐