spring 3.0 mvc在从后台向前台返回时要转化成json串,但页面上报了

The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers


异常信息

org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation


后台controllor

(= = RequestMethod.)
Map ((= = ) String custToken) {
    Map returnMap = HashMap() result = .queryYebAssets(custToken)returnMap.put(result)returnMap}



网上很多的说法是引入如下两个包

       

            org.codehaus.jackson

            jackson-core-asl

       

       

            org.codehaus.jackson

            jackson-mapper-asl

       

除此之外还要修改spring的配置文件里加入如下

class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
 
  name="messageConverters">
     
        class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter" />
     
 


本项目中引入了其他的json文件,并没有引入上述的两个包。配置文件中加上后也是可以正常转化的。