Why it doesn't work until I delete @EnableWebMvc
When you use @EnableWebMvc, you tell Spring Boot that you want to have full control over the configuration of Spring MVC. This is described in Spring's download help documentation , which states that "the easiest way to get full control over your MVC configuration is to provide your own @Configurationwith annotation @EnableWebMvc. This will leave the entire MVC configuration in your hands."
ObjectMapper, MappingJackson2HttpMessageConverter Spring - mvc
ObjectMapper 9 !
MappingJackson2HttpMessageConverter 8 !
?
ObjectMapper MappingJackson2HttpMessageConverter Spring MVC ( ). Spring .
@Autowired ObjectMapper?
Autowiring Spring beans. Spring bean, .
: - , , ?
Spring . @EnableWebMvc, , , , . , , , @Autowired, Spring Framework.