Spring Framework HttpMediaTypeNotSupportedException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework HttpMediaTypeNotSupportedException class.

This code example shows how to use the following methods:getSupportedMediaTypes
    } 
 
    @Override 
    protected HttpHeaders createHeaders(HttpMediaTypeNotSupportedException ex, HttpServletRequest req) {
 
        HttpHeaders headers = super.createHeaders(ex, req);
        List<MediaType> mediaTypes = ex.getSupportedMediaTypes();
 
        if (!isEmpty(mediaTypes)) {
            headers.setAccept(mediaTypes);
        } 
        return headers;
    } 
} 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java