Example usage for org.springframework.web HttpRequestMethodNotSupportedException getClass

List of usage examples for org.springframework.web HttpRequestMethodNotSupportedException getClass

Introduction

In this page you can find the example usage for org.springframework.web HttpRequestMethodNotSupportedException getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:br.com.modoagil.asr.rest.support.RESTErrorHandler.java

/**
 * Manipula exceo para status HTTP {@code 405}
 *
 * @param ex//from   w ww.  j a v a  2  s  .  c  om
 *            {@link HttpRequestMethodNotSupportedException}
 * @return resposta ao cliente
 */
@ResponseBody
@ExceptionHandler(HttpRequestMethodNotSupportedException.class)
public Response<E> processHttpRequestMethodNotSupportedException(
        final HttpRequestMethodNotSupportedException ex) {
    this.logger.info(
            "handleHttpRequestMethodNotSupportedException - Catching: " + ex.getClass().getSimpleName(), ex);
    return new ResponseBuilder<E>().success(false).message(ex.getMethod() + " no suportado.")
            .status(HttpStatus.METHOD_NOT_ALLOWED).build();
}

From source file:com.haulmont.restapi.idp.IdpAuthController.java

@ExceptionHandler(HttpRequestMethodNotSupportedException.class)
public ResponseEntity<OAuth2Exception> handleHttpRequestMethodNotSupportedException(
        HttpRequestMethodNotSupportedException e) throws Exception {
    log.info("Handling error: {}, {}", e.getClass().getSimpleName(), e.getMessage());
    return getExceptionTranslator().translate(e);
}