I\'m using Spring Boot with @ResponseBody based approach like the following:
@RequestMapping(value = VIDEO_DATA_PATH, method = RequestMethod.GET) public @Respons
This is very simply done by throwing org.springframework.web.server.ResponseStatusException:
throw new ResponseStatusException( HttpStatus.NOT_FOUND, "entity not found" );
It's compatible with @ResponseBody and with any return value. Requires Spring 5+