How can I verify required header if it's missing or wrong format?
@RequestMapping(value = "/example/{id}", method = RequestMethod.PUT) public ResponseEntity<> update(@RequestHeader(value="last-modified-date") String lastModDate, HttpServletRequest request, @RequestBody ReBody rebody, @PathVariable("id") int id) throws Exception{ // Stuff here... }
the format of "lastModDate" likes "Mon, 28 Aug 2017 02:51:09 GMT"
I would like to do some custom validation on the header attribute i.e.
if (lastModDate == null) { throw Exception();}
or throw the exception when it's in the wrong format.