Code examples for the 'Binary Data Formats in a Spring REST API'
article.
This commit is contained in:
@@ -3,11 +3,13 @@ package org.baeldung.config;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
|
||||
import org.baeldung.config.converter.KryoHttpMessageConverter;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.converter.HttpMessageConverter;
|
||||
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
|
||||
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
|
||||
import org.springframework.http.converter.protobuf.ProtobufHttpMessageConverter;
|
||||
import org.springframework.http.converter.xml.MarshallingHttpMessageConverter;
|
||||
import org.springframework.oxm.xstream.XStreamMarshaller;
|
||||
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
||||
@@ -33,7 +35,8 @@ public class WebConfig extends WebMvcConfigurerAdapter {
|
||||
builder.indentOutput(true).dateFormat(new SimpleDateFormat("dd-MM-yyyy hh:mm"));
|
||||
messageConverters.add(new MappingJackson2HttpMessageConverter(builder.build()));
|
||||
// messageConverters.add(new MappingJackson2XmlHttpMessageConverter(builder.createXmlMapper(true).build()));
|
||||
|
||||
messageConverters.add(new ProtobufHttpMessageConverter());
|
||||
messageConverters.add(new KryoHttpMessageConverter());
|
||||
super.configureMessageConverters(messageConverters);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user