首页 > 代码库 > @ResponseStatus

@ResponseStatus

返回一个指定的http response状态码。

@ResponseStatus(value = http://www.mamicode.com/HttpStatus.NOT_FOUND, reason ="IOException occured")@ExceptionHandler(IOException.class)@ResponseBodypublic void handleIOException() {    // returning 404 error code}

技术分享

 

@ResponseStatus