/** Exception thrown when a request handler does not support a specific request method. */
 @ExceptionHandler(HttpRequestMethodNotSupportedException.class)
 public ResponseEntity<Map<String, Object>> handleHttpRequestMethodNotSupportedException(
     HttpRequestMethodNotSupportedException error) {
   Map<String, Object> errorMap = new HashMap<String, Object>();
   errorMap.put("hasErrors", "true");
   errorMap.put(
       "developerMessage",
       error.getMethod()
           + " supports only "
           + error.getSupportedHttpMethods()
           + ", change the request type to "
           + error.getSupportedHttpMethods());
   errorMap.put("userMessage", "");
   errorMap.put("moreInfo", error.getMessage());
   errorMap.put("errorCode", HttpStatus.METHOD_NOT_ALLOWED);
   error.printStackTrace();
   return new ResponseEntity<Map<String, Object>>(errorMap, HttpStatus.METHOD_NOT_ALLOWED);
 }