jersey web service json utf-8 encoding

后端 未结 7 2051
执笔经年
执笔经年 2020-12-08 00:28

I made a small Rest webservice using Jersey 1.11. When i call the url that returns Json, there are problems with the character encoding for non english characters. The corre

7条回答
  •  心在旅途
    2020-12-08 01:03

    responseMessage is bean class in which we can send UTF-8 charset in response.

    return Response.ok(responseMessage).header("Content-Type", "application/json;charset=UTF-8").build();
    

提交回复
热议问题