Package org.springframework.http.converter

Examples of org.springframework.http.converter.HttpMessageConverter


    String content = "{\"name\" : \"Jad\"}";
    this.servletRequest.setContent(content.getBytes("UTF-8"));
    this.servletRequest.setContentType(MediaType.APPLICATION_JSON_VALUE);

    List<HttpMessageConverter<?>> converters = new ArrayList<HttpMessageConverter<?>>();
    HttpMessageConverter target = new MappingJackson2HttpMessageConverter();
    HttpMessageConverter proxy = ProxyFactory.getProxy(HttpMessageConverter.class, new SingletonTargetSource(target));
    converters.add(proxy);
    RequestResponseBodyMethodProcessor processor = new RequestResponseBodyMethodProcessor(converters);

    SimpleBean result = (SimpleBean) processor.resolveArgument(methodParam, mavContainer, webRequest, binderFactory);
View Full Code Here


   */
  private void handle(final Object error,
      final HttpServletRequest request, final HttpServletResponse response)
      throws IOException {
    MediaType contentType = contentType(request);
    HttpMessageConverter converter =
        messageConverter(contentType, error, request);
    response.setStatus(responseStatus.value());
    HttpOutputMessage output = new ServletServerHttpResponse(response);
    converter.write(error, contentType, output);
  }
View Full Code Here

TOP

Related Classes of org.springframework.http.converter.HttpMessageConverter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.