@ExceptionHandler(HttpRequestMethodNotSupportedException.class) @ResponseBody @ResponseStatus(HttpStatus.METHOD_NOT_ALLOWED) public String handleException(final HttpRequestMethodNotSupportedException e){
  return convertErrorAsJson(e.getMessage());
}

@ ExceptionHandler ( HttpRequestMethodNotSupportedException . class ) @ ResponseBody @ ResponseStatus ( HttpStatus . METHOD_NOT_ALLOWED ) public String handleException ( final HttpRequestMethodNotSupportedException e ) { return convertErrorAsJson ( e . getMessage ( ) ) ; }
handles httprequestmethodnotsupportedexception thrown by a rest api web service when request is received with unsupported http method . < p / >
