Spring 处理 fastjson MediaType.All 的情况

 1     /**
 2          * fastJson 的MediaType.All的情况Spring默认会使用一个字节流,而不是识别成json,这里对它进行一下覆盖处理
 3          */
 4         public static class FastJsonHttpMessageConvert5 extends FastJsonHttpMessageConverter4 {
 5             static final Charset DEFAULT_CHAREST = Charset.forName("UTF-8");
 6             FastJsonHttpMessageConvert5(){
 7                 setDefaultCharset(DEFAULT_CHAREST);
 8                 setSupportedMediaTypes(Arrays.asList(MediaType.APPLICATION_JSON,new MediaType("application","*+json")));
 9             }
10         }
原文地址:https://www.cnblogs.com/liamlee/p/10544219.html