Let\'s take a look at the following simple test controller (Used with Spring 4.0.3):
@RestController
public class Te
You can remove the StringHttpMessageConverter
which is registered before the jackson converter, - like mentioned in the comment.
/**
* Unregister the default {@link StringHttpMessageConverter} as we want
* Strings to be handled by the JSON converter.
*
* Our MappingJackson2HttpMessageConverter will deal with strings.
*
* @param converters
* List of already configured converters
*/
@Override
public void extendMessageConverters(List> converters) {
converters.removeIf(converter -> converter instanceof StringHttpMessageConverter);
}