I\'m using Spring Boot with @ResponseBody based approach like the following:
@RequestMapping(value = VIDEO_DATA_PATH, method = RequestMethod.GET)
public @Respons
You can just set responseStatus on res like this:
@RequestMapping(value = VIDEO_DATA_PATH, method = RequestMethod.GET)
public ResponseEntity getData(@PathVariable(ID_PARAMETER) long id,
HttpServletResponse res) {
...
res.setStatus(HttpServletResponse.SC_NOT_FOUND);
// or res.setStatus(404)
return null; // or build some response entity
...
}