List of usage examples for org.springframework.web.servlet.mvc.method.annotation HttpEntityMethodProcessor HttpEntityMethodProcessor
public HttpEntityMethodProcessor(List<HttpMessageConverter<?>> converters,
List<Object> requestResponseBodyAdvice)
From source file:cz.jirutka.spring.exhandler.RestHandlerExceptionResolver.java
@Override public void afterPropertiesSet() { if (contentNegotiationManager == null) { contentNegotiationManager = new ContentNegotiationManager(new HeaderContentNegotiationStrategy(), new FixedContentNegotiationStrategy(defaultContentType)); }// w ww.j a v a2s. c o m responseProcessor = new HttpEntityMethodProcessor(messageConverters, contentNegotiationManager); fallbackResponseProcessor = new HttpEntityMethodProcessor(messageConverters, new ContentNegotiationManager(new FixedContentNegotiationStrategy(defaultContentType))); }
From source file:co.paralleluniverse.springframework.web.servlet.mvc.method.annotation.FiberRequestMappingHandlerAdapter.java
/** * Return the list of return value handlers to use including built-in and * custom handlers provided via {@link #setReturnValueHandlers}. *///ww w . ja v a 2 s . c o m private List<HandlerMethodReturnValueHandler> getDefaultReturnValueHandlers() { List<HandlerMethodReturnValueHandler> handlers = new ArrayList<>(); // Single-purpose return value types handlers.add(new ModelAndViewMethodReturnValueHandler()); handlers.add(new ModelMethodProcessor()); handlers.add(new ViewMethodReturnValueHandler()); handlers.add(new HttpEntityMethodProcessor(getMessageConverters(), this.contentNegotiationManager)); handlers.add(new HttpHeadersReturnValueHandler()); handlers.add(new CallableMethodReturnValueHandler()); handlers.add(new DeferredResultMethodReturnValueHandler()); handlers.add(new AsyncTaskMethodReturnValueHandler(this.beanFactory)); // Annotation-based return value types handlers.add(new ModelAttributeMethodProcessor(false)); handlers.add( new RequestResponseBodyMethodProcessor(getMessageConverters(), this.contentNegotiationManager)); // Multi-purpose return value types handlers.add(new ViewNameMethodReturnValueHandler()); handlers.add(new MapMethodProcessor()); // Custom return value types if (getCustomReturnValueHandlers() != null) { handlers.addAll(getCustomReturnValueHandlers()); } // Catch-all if (!CollectionUtils.isEmpty(getModelAndViewResolvers())) { handlers.add(new ModelAndViewResolverMethodReturnValueHandler(getModelAndViewResolvers())); } else { handlers.add(new ModelAttributeMethodProcessor(true)); } return handlers; }