Example usage for org.springframework.web HttpRequestMethodNotSupportedException HttpRequestMethodNotSupportedException

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

Introduction

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

Prototype

public HttpRequestMethodNotSupportedException(String method) 

Source Link

Document

Create a new HttpRequestMethodNotSupportedException.

Usage

From source file:com.haulmont.restapi.ldap.LdapAuthController.java

@RequestMapping(value = "/v2/ldap/token", method = RequestMethod.GET)
public ResponseEntity<OAuth2AccessToken> getAccessToken(Principal principal,
        @RequestParam Map<String, String> parameters, HttpServletRequest request)
        throws HttpRequestMethodNotSupportedException {
    if (!allowedRequestMethods.contains(HttpMethod.GET)) {
        throw new HttpRequestMethodNotSupportedException("GET");
    }/*from   w ww.j  av a2  s. c  om*/

    return postAccessToken(principal, parameters, request);
}

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

@GetMapping(value = "/v2/idp/token")
public ResponseEntity<OAuth2AccessToken> getAccessToken(Principal principal,
        @RequestParam Map<String, String> parameters, HttpServletRequest request)
        throws HttpRequestMethodNotSupportedException {

    if (!allowedRequestMethods.contains(HttpMethod.GET)) {
        throw new HttpRequestMethodNotSupportedException("GET");
    }/*w w  w. j  a va  2  s.  c  o m*/

    return postAccessToken(principal, parameters, request);
}