I\'m using Spring Boot with @ResponseBody based approach like the following:
@RequestMapping(value = VIDEO_DATA_PATH, method = RequestMethod.GET) public @Respons
Create a NotFoundException class with an @ResponseStatus(HttpStatus.NOT_FOUND) annotation and throw it from your controller.
NotFoundException
@ResponseStatus(HttpStatus.NOT_FOUND)
@ResponseStatus(code = HttpStatus.NOT_FOUND, reason = "video not found") public class VideoNotFoundException extends RuntimeException { }