I want to configure my web methods to set the http status code to 404 or an other code indicating that something went wrong (e.g. 444 No Response).
Currently the response is http 200 with null in its body.
@RequestMapping(value = "folder", method = RequestMethod.GET)
@ResponseBody
public Folder findFolder(String folderId, WebRequest request) throws PermissionDeniedException, ServiceException {
return projectService.findFolder(folderId); // should set HttpCode.NO_RESPONSE if the method returns null
}
Is there a central way to configure the web services rather than handling null values one by one in each method?
Alternatively, is there a way to bind an @ExceptionHandler (or rather @SomeGenereicHandler) to null return values?