Closed liliang8858 closed 6 years ago
可以把具体错误发出来,考虑配置下spring json convertor.
请求 406
已经解决 谢谢
方法:
1.继承 extends WebMvcConfigurerAdapter
2.覆盖方法:
`@Override
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
super.configureMessageConverters(converters);
//1.需要定义一个convert转换消息的对象;
FastJsonHttpMessageConverter fastJsonHttpMessageConverter = new FastJsonHttpMessageConverter();
//2.添加fastJson的配置信息,比如:是否要格式化返回的json数据;
FastJsonConfig fastJsonConfig = new FastJsonConfig();
fastJsonConfig.setSerializerFeatures(SerializerFeature.PrettyFormat);
//3处理中文乱码问题
List
// converters.add(responseBodyConverter()); }`
报错: 什么原因
org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find