解决方式1:
@RequestMapping(value="/shopsList.json", produces = "text/html;charset=UTF-8")
@ResponseBody
解决方式2:
<!-- 默认的注解映射的支持 --> <mvc:annotation-driven> <mvc:message-converters> <bean class="org.springframework.http.converter.StringHttpMessageConverter" /> <!-- 关键先加上这句 --> <bean class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter"> <property name="objectMapper"> <bean class="com.gwzx.framework.web.json.CustomObjectMapper" /> </property> </bean> </mvc:message-converters> </mvc:annotation-driven>