org.springframework.web.servlet.mvc.method.annotation.HttpEntityMethodProcessor Java Examples
The following examples show how to use
org.springframework.web.servlet.mvc.method.annotation.HttpEntityMethodProcessor.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JsonViewSupportFactoryBean.java From json-view with GNU General Public License v3.0 | 5 votes |
protected void decorateHandlers(List<HandlerMethodReturnValueHandler> handlers) { List<HttpMessageConverter<?>> converters = new ArrayList<>(adapter.getMessageConverters()); converters.add(converter); for(HandlerMethodReturnValueHandler handler : handlers) { int index = handlers.indexOf(handler); if(handler instanceof HttpEntityMethodProcessor) { handlers.set(index, new JsonViewHttpEntityMethodProcessor(converters)); } else if(handler instanceof RequestResponseBodyMethodProcessor) { handlers.set(index, new JsonViewReturnValueHandler(converters, defaultView)); break; } } }
Example #2
Source File: UifRequestMappingHandlerAdapter.java From rice with Educational Community License v2.0 | 4 votes |
/** * Return the list of argument resolvers to use including built-in resolvers * and custom resolvers provided via {@link #setCustomArgumentResolvers}. */ protected List<HandlerMethodArgumentResolver> getUifArgumentResolvers() { List<HandlerMethodArgumentResolver> resolvers = new ArrayList<HandlerMethodArgumentResolver>(); resolvers.add(new UifDefaultFormMethodArgumentResolver()); // Annotation-based argument resolution resolvers.add(new RequestParamMethodArgumentResolver(getBeanFactory(), false)); resolvers.add(new RequestParamMapMethodArgumentResolver()); resolvers.add(new PathVariableMethodArgumentResolver()); resolvers.add(new PathVariableMapMethodArgumentResolver()); resolvers.add(new MatrixVariableMethodArgumentResolver()); resolvers.add(new MatrixVariableMapMethodArgumentResolver()); resolvers.add(new ServletModelAttributeMethodProcessor(false)); resolvers.add(new RequestResponseBodyMethodProcessor(getMessageConverters())); resolvers.add(new RequestPartMethodArgumentResolver(getMessageConverters())); resolvers.add(new RequestHeaderMethodArgumentResolver(getBeanFactory())); resolvers.add(new RequestHeaderMapMethodArgumentResolver()); resolvers.add(new ServletCookieValueMethodArgumentResolver(getBeanFactory())); resolvers.add(new ExpressionValueMethodArgumentResolver(getBeanFactory())); // Type-based argument resolution resolvers.add(new ServletRequestMethodArgumentResolver()); resolvers.add(new ServletResponseMethodArgumentResolver()); resolvers.add(new HttpEntityMethodProcessor(getMessageConverters())); resolvers.add(new RedirectAttributesMethodArgumentResolver()); resolvers.add(new ModelMethodProcessor()); resolvers.add(new MapMethodProcessor()); resolvers.add(new ErrorsMethodArgumentResolver()); resolvers.add(new SessionStatusMethodArgumentResolver()); resolvers.add(new UriComponentsBuilderMethodArgumentResolver()); // Custom arguments if (getCustomArgumentResolvers() != null) { resolvers.addAll(getCustomArgumentResolvers()); } // Catch-all resolvers.add(new RequestParamMethodArgumentResolver(getBeanFactory(), true)); resolvers.add(new ServletModelAttributeMethodProcessor(true)); return resolvers; }