You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/11/28 09:54:18 UTC

[GitHub] [dubbo] YangSihong opened a new issue, #11043: dubbo3.1 rest protocol :How to specify the SerializerFeature of fastjson

YangSihong opened a new issue, #11043:
URL: https://github.com/apache/dubbo/issues/11043

   I tried to do this,But it didn't work at all。
    @Bean
       public HttpMessageConverters fastJsonHttpMessageConverters() {
           FastJsonHttpMessageConverter fastConvert = new FastJsonHttpMessageConverter();
           FastJsonConfig fastJsonConfig = new FastJsonConfig();
           fastJsonConfig.setSerializerFeatures(SerializerFeature.PrettyFormat,
                   SerializerFeature.WriteMapNullValue);
           //处理日期时间格式化问题
           fastJsonConfig.setDateFormat("yyyy-MM-dd hh:mm:ss");
           //处理中文乱码问题
           List<MediaType> fastMediaTypes = new ArrayList<>();
           fastMediaTypes.add(MediaType.APPLICATION_JSON_UTF8);
           fastConvert.setSupportedMediaTypes(fastMediaTypes);
           fastConvert.setFastJsonConfig(fastJsonConfig);
           return new HttpMessageConverters((HttpMessageConverter<?>) fastConvert);
       }
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #11043: dubbo3.1 rest protocol :How to specify the SerializerFeature of fastjson

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on issue #11043:
URL: https://github.com/apache/dubbo/issues/11043#issuecomment-1329970040

   Duplicated with https://github.com/apache/dubbo/issues/11042


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ closed issue #11043: dubbo3.1 rest protocol :How to specify the SerializerFeature of fastjson

Posted by GitBox <gi...@apache.org>.
AlbumenJ closed issue #11043: dubbo3.1 rest protocol :How to specify the SerializerFeature of fastjson
URL: https://github.com/apache/dubbo/issues/11043


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org