minor configuration work

This commit is contained in:
eugenp 2014-01-10 13:49:11 +02:00
parent 72edb72fd5
commit 0f8409bf7d
1 changed files with 7 additions and 8 deletions

View File

@ -20,25 +20,24 @@ public class WebConfig extends WebMvcConfigurerAdapter {
super();
}
// API
//
@Override
public void configureMessageConverters(final List<HttpMessageConverter<?>> messageConverters) {
messageConverters.add(marshallingHttpMessageConverter());
messageConverters.add(createXmlHttpMessageConverter());
messageConverters.add(new MappingJackson2HttpMessageConverter());
super.configureMessageConverters(messageConverters);
}
// UTIL
private HttpMessageConverter<Object> createXmlHttpMessageConverter() {
final MarshallingHttpMessageConverter xmlConverter = new MarshallingHttpMessageConverter();
private final MarshallingHttpMessageConverter marshallingHttpMessageConverter() {
final MarshallingHttpMessageConverter marshallingHttpMessageConverter = new MarshallingHttpMessageConverter();
final XStreamMarshaller xstreamMarshaller = new XStreamMarshaller();
marshallingHttpMessageConverter.setMarshaller(xstreamMarshaller);
marshallingHttpMessageConverter.setUnmarshaller(xstreamMarshaller);
xmlConverter.setMarshaller(xstreamMarshaller);
xmlConverter.setUnmarshaller(xstreamMarshaller);
return marshallingHttpMessageConverter;
return xmlConverter;
}
}