406 Spring MVC Json, not acceptable according to the request “accept” headers

后端 未结 6 722
攒了一身酷
攒了一身酷 2020-12-05 19:39

have following details in my pom.xml

    
        org.codehaus.jackson
        jackson-cor         


        
6条回答
  •  情书的邮戳
    2020-12-05 20:18

    It worked for me with the below dependencies and @EnableWebMvc in my RestController, Please see that I just added jackson-databind dependency.

      
        4.2.1.RELEASE
      
    
      
        
          org.springframework
          spring-core
          ${spring-version}  
        
        
          org.springframework
          spring-webmvc
          ${spring-version}
        
        
          org.springframework
          spring-web
          ${spring-version}
        
        
          junit
          junit
          3.8.1
          test
        
        
          com.fasterxml.jackson.core
          jackson-databind
          2.5.3
        
      
    

提交回复
热议问题