if (defaultResolver == null)
defaultResolver = viewResolver;
}
if (mimeTypeToViewResolver.containsKey(MediaType.APPLICATION_JSON_VALUE) == false) {
ViewResolver viewResolver = new ViewResolver() {
@Override
public View resolveViewName(String viewName, Locale locale) throws Exception {
MappingJacksonJsonView jsonView = new MappingJacksonJsonView();
jsonView.setApplicationContext(getApplicationContext());
return jsonView;
}
};
mimeTypeToViewResolver.put(MediaType.APPLICATION_JSON_VALUE, viewResolver);
}
if (mimeTypeToViewResolver.containsKey(MediaType.TEXT_XML_VALUE) == false) {
ViewResolver viewResolver = new ViewResolver() {
@Override
public View resolveViewName(String viewName, Locale locale) throws Exception {
XStreamMarshaller marshaller = new XStreamMarshaller();
marshaller.setAutodetectAnnotations(true);
MarshallingView view = new MarshallingView(marshaller);