You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "zhangbingyan (GitHub)" <gi...@apache.org> on 2018/11/05 09:18:59 UTC

[GitHub] [incubator-dubbo] zhangbingyan commented on issue #2732: dubbo使用rest协议,集成tomcat时,postman传参中文乱码

> I need your interface definition to find out the problem And make sure `@Produces({"application/json; charset=UTF-8", "text/xml; charset=UTF-8"})` is set to your interface.

是的,我确定接口上有注释@@Produces({"application/json; charset=UTF-8", "text/xml; charset=UTF-8"}),但是依然有乱码,最后我发现参数解码的时候使用的是默认的ISO-8859-1编码(见org.apache.tomcat.util.http.Parameters),需要设置request的编码方式,实现ContainerRequestFilter的filter方法,在RpcContext上下文中设置HttpServletRequest的CharacterEncoding,建议这部分写到源码中!

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2732 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org