本文整理汇总了Java中org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor类的典型用法代码示例。如果您正苦于以下问题:Java RequestResponseBodyMethodProcessor类的具体用法?Java RequestResponseBodyMethodProcessor怎么用?Java RequestResponseBodyMethodProcessor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RequestResponseBodyMethodProcessor类属于org.springframework.web.servlet.mvc.method.annotation包,在下文中一共展示了RequestResponseBodyMethodProcessor类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getArgumentResolvers
import org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor; //导入依赖的package包/类
private List<HandlerMethodArgumentResolver> getArgumentResolvers(List<HttpMessageConverter<?>> messageConverters) {
List<HandlerMethodArgumentResolver> resolvers = new LinkedList<>();
resolvers.add(new RequestParamMethodArgumentResolver(beanFactory, false));
resolvers.add(new RequestParamMapMethodArgumentResolver());
resolvers.add(new MatrixVariableMethodArgumentResolver());
resolvers.add(new MatrixVariableMapMethodArgumentResolver());
resolvers.add(new ServletModelAttributeMethodProcessor(false));
resolvers.add(new RequestResponseBodyMethodProcessor(messageConverters));
resolvers.add(new RequestPartMethodArgumentResolver(messageConverters));
resolvers.add(new RequestHeaderMethodArgumentResolver(beanFactory));
resolvers.add(new RequestHeaderMapMethodArgumentResolver());
resolvers.add(new ServletCookieValueMethodArgumentResolver(beanFactory));
resolvers.add(new ExpressionValueMethodArgumentResolver(beanFactory));
resolvers.add(new ServletRequestMethodArgumentResolver());
resolvers.add(new ServletResponseMethodArgumentResolver());
resolvers.add(new HttpEntityMethodProcessor(messageConverters));
resolvers.add(new RedirectAttributesMethodArgumentResolver());
resolvers.add(new ModelMethodProcessor());
resolvers.add(new MapMethodProcessor());
resolvers.add(new ErrorsMethodArgumentResolver());
resolvers.add(new SessionStatusMethodArgumentResolver());
resolvers.add(new UriComponentsBuilderMethodArgumentResolver());
resolvers.add(new RequestParamMethodArgumentResolver(beanFactory, true));
resolvers.add(new ServletModelAttributeMethodProcessor(true));
return resolvers;
}
示例2: ProxyExchange
import org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor; //导入依赖的package包/类
public ProxyExchange(RestTemplate rest, NativeWebRequest webRequest,
ModelAndViewContainer mavContainer, WebDataBinderFactory binderFactory,
Type type) {
this.responseType = type;
this.rest = createTemplate(rest);
this.webRequest = webRequest;
this.mavContainer = mavContainer;
this.binderFactory = binderFactory;
this.delegate = new RequestResponseBodyMethodProcessor(
rest.getMessageConverters());
}
示例3: FluxReturnValueHandler
import org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor; //导入依赖的package包/类
public FluxReturnValueHandler(FunctionInspector inspector,
List<HttpMessageConverter<?>> messageConverters) {
this.inspector = inspector;
this.delegate = new ResponseBodyEmitterReturnValueHandler(messageConverters);
this.single = new RequestResponseBodyMethodProcessor(messageConverters);
Method method = ReflectionUtils.findMethod(getClass(), "singleValue");
singleReturnType = new MethodParameter(method, -1);
}
示例4: decorateHandlers
import org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor; //导入依赖的package包/类
private 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;
}
}
}
示例5: decorateHandlers
import org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor; //导入依赖的package包/类
private void decorateHandlers(List<HandlerMethodReturnValueHandler> handlers) {
for (HandlerMethodReturnValueHandler handler : handlers) {
if (handler instanceof RequestResponseBodyMethodProcessor) {
JsonResponseInjectingReturnValueHandler decorator = new JsonResponseInjectingReturnValueHandler(handler);
int index = handlers.indexOf(handler);
handlers.set(index, decorator);
this.log.info("JsonResponse decorator support wired up");
break;
}
}
}
示例6: decorateHandlers
import org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor; //导入依赖的package包/类
private void decorateHandlers(List<HandlerMethodReturnValueHandler> handlers) {
for (HandlerMethodReturnValueHandler handler : handlers) {
if (handler instanceof RequestResponseBodyMethodProcessor)
{
JsonResponseInjectingReturnValueHandler decorator = new JsonResponseInjectingReturnValueHandler(handler);
int index = handlers.indexOf(handler);
handlers.set(index, decorator);
log.info("JsonResponse decorator support wired up");
break;
}
}
}
示例7: decorateHandlers
import org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor; //导入依赖的package包/类
private void decorateHandlers(List<HandlerMethodReturnValueHandler> handlers) {
for (HandlerMethodReturnValueHandler handler : handlers) {
if (handler instanceof RequestResponseBodyMethodProcessor) {
//用自己的ResponseBody包装类替换掉框架的
//达到返回Result的效果
ResponseBodyWrapHandler decorator = new ResponseBodyWrapHandler(handler, basePackage);
int index = handlers.indexOf(handler);
handlers.set(index, decorator);
break;
}
}
}
示例8: addReturnValueHandlers
import org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor; //导入依赖的package包/类
@Override
public void addReturnValueHandlers(final List<HandlerMethodReturnValueHandler> returnValueHandlers) {
List<HttpMessageConverter<?>> messageConverters = new ArrayList<>();
messageConverters.add(new MappingJackson2HttpMessageConverter());
returnValueHandlers.add(new RequestResponseBodyMethodProcessor(messageConverters));
}
示例9: getUifArgumentResolvers
import org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor; //导入依赖的package包/类
/**
* 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;
}
示例10: setMessageConverters
import org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor; //导入依赖的package包/类
public void setMessageConverters(List<HttpMessageConverter<?>> messageConverters) {
requestResponseBodyMethodProcessor = new RequestResponseBodyMethodProcessor(messageConverters);
}
开发者ID:jkschneider,项目名称:spring-mvc-requestbodypart,代码行数:4,代码来源:RequestBodyPartMethodArgumentResolver.java