Package org.springframework.http.converter

Examples of org.springframework.http.converter.StringHttpMessageConverter


  public AnnotationMethodHandlerAdapter() {
    // no restriction of HTTP methods by default
    super(false);

    // See SPR-7316
    StringHttpMessageConverter stringHttpMessageConverter = new StringHttpMessageConverter();
    stringHttpMessageConverter.setWriteAcceptCharset(false);
    this.messageConverters = new HttpMessageConverter[]{new ByteArrayHttpMessageConverter(), stringHttpMessageConverter,
        new SourceHttpMessageConverter(), new XmlAwareFormHttpMessageConverter()};
  }
View Full Code Here


  private RestTemplate restTemplate;

  @Before
  public void setup() {
    List<HttpMessageConverter<?>> converters = new ArrayList<HttpMessageConverter<?>>();
    converters.add(new StringHttpMessageConverter());
    converters.add(new MappingJacksonHttpMessageConverter());

    this.restTemplate = new RestTemplate();
    this.restTemplate.setMessageConverters(converters);
View Full Code Here

  private RestTemplate restTemplate;

  @Before
  public void setup() {
    List<HttpMessageConverter<?>> converters = new ArrayList<HttpMessageConverter<?>>();
    converters.add(new StringHttpMessageConverter());
    converters.add(new MappingJacksonHttpMessageConverter());

    this.restTemplate = new RestTemplate();
    this.restTemplate.setMessageConverters(converters);
View Full Code Here

  }

  private List<HttpMessageConverter<?>> getHttpMessageConverters() {
    List<HttpMessageConverter<?>> messageConverters = new ArrayList<HttpMessageConverter<?>>();
    messageConverters.add(new ByteArrayHttpMessageConverter());
    messageConverters.add(new StringHttpMessageConverter());
    messageConverters.add(new ResourceHttpMessageConverter());
    messageConverters.add(new UploadApplicationPayloadHttpMessageConverter());
    messageConverters.add(getFormHttpMessageConverter());
    messageConverters.add(new MappingJacksonHttpMessageConverter());
    return messageConverters;
View Full Code Here

    return formPartsMessageConverter;
  }

  private List<HttpMessageConverter<?>> getFormPartsMessageConverters() {
    List<HttpMessageConverter<?>> partConverters = new ArrayList<HttpMessageConverter<?>>();
    StringHttpMessageConverter stringConverter = new StringHttpMessageConverter();
    stringConverter.setSupportedMediaTypes(Collections.singletonList(JsonUtil.JSON_MEDIA_TYPE));
    stringConverter.setWriteAcceptCharset(false);
    partConverters.add(stringConverter);
    partConverters.add(new ResourceHttpMessageConverter());
    partConverters.add(new UploadApplicationPayloadHttpMessageConverter());
    return partConverters;
  }
View Full Code Here

public class Main {

  public static void main(String[] args) {

    List<HttpMessageConverter<?>> converters = new ArrayList<HttpMessageConverter<?>>(1);
    converters.add(new StringHttpMessageConverter());
    converters.add(new MappingJackson2HttpMessageConverter());

    RestTemplate restTemplate = new RestTemplate(converters);
//    restTemplate.setRequestFactory(new HttpComponentsClientHttpRequestFactory());
View Full Code Here

        protected List<HttpMessageConverter<?>> getMessageConverters() {
            List<HttpMessageConverter<?>> converters = new ArrayList<>();
            converters.add(new JsonStringConverter());
            converters.add(new MarkdownHtmlConverter());
            converters.add(new DownloadConverter());
            converters.add(new StringHttpMessageConverter(Charset.forName("UTF-8")));
            return converters;
        }
View Full Code Here

  }

  private static final RestOperations createDefaultTemplate(List<MediaType> mediaTypes) {

    List<HttpMessageConverter<?>> converters = new ArrayList<HttpMessageConverter<?>>();
    converters.add(new StringHttpMessageConverter(Charset.forName("UTF-8")));

    if (mediaTypes.contains(MediaTypes.HAL_JSON)) {
      converters.add(getHalConverter());
    }
View Full Code Here

   * Create a new instance of the {@link RestTemplate} using default settings.
   * Default {@link HttpMessageConverter}s are initialized.
   */
  public RestTemplate() {
    this.messageConverters.add(new ByteArrayHttpMessageConverter());
    this.messageConverters.add(new StringHttpMessageConverter());
    this.messageConverters.add(new ResourceHttpMessageConverter());
    this.messageConverters.add(new SourceHttpMessageConverter<Source>());
    this.messageConverters.add(new AllEncompassingFormHttpMessageConverter());

    if (romePresent) {
View Full Code Here

  /**
   * Default constructor.
   */
  public RequestMappingHandlerAdapter() {

    StringHttpMessageConverter stringHttpMessageConverter = new StringHttpMessageConverter();
    stringHttpMessageConverter.setWriteAcceptCharset(false); // See SPR-7316

    this.messageConverters = new ArrayList<HttpMessageConverter<?>>();
    this.messageConverters.add(new ByteArrayHttpMessageConverter());
    this.messageConverters.add(stringHttpMessageConverter);
    this.messageConverters.add(new SourceHttpMessageConverter<Source>());
View Full Code Here

TOP

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

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.