List of usage examples for org.springframework.web.servlet HandlerMapping PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE
String PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE
To view the source code for org.springframework.web.servlet HandlerMapping PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE.
Click Source Link
From source file:org.beadle.framework.view.ReturnTypeViewResolver.java
@SuppressWarnings("unchecked") private List<MediaType> getProducibleMediaTypes(HttpServletRequest request) { Set<MediaType> mediaTypes = (Set<MediaType>) request .getAttribute(HandlerMapping.PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE); if (!CollectionUtils.isEmpty(mediaTypes)) { return new ArrayList<MediaType>(mediaTypes); } else {/*from w w w .j ava 2 s . co m*/ return Collections.singletonList(MediaType.ALL); } }
From source file:org.springframework.web.servlet.mvc.method.annotation.ReactiveTypeHandler.java
@SuppressWarnings("unchecked") private Collection<MediaType> getMediaTypes(NativeWebRequest request) throws HttpMediaTypeNotAcceptableException { Collection<MediaType> mediaTypes = (Collection<MediaType>) request .getAttribute(HandlerMapping.PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE, RequestAttributes.SCOPE_REQUEST); return CollectionUtils.isEmpty(mediaTypes) ? this.contentNegotiationManager.resolveMediaTypes(request) : mediaTypes;/*w w w.ja va 2 s . c o m*/ }