我有一个控制器,它必须返回一个带有俄语名称的JSON字符串,但我得到的响应是????(无效字符)。
@Controller
public class ManifestController {
@ResponseBody
@RequestMapping(value = {"/manifest.json","/manifest"}, method = { RequestMethod.GET }, produces = {MediaType.APPLICATION_JSON_VALUE})
public String getManifestJson(
HttpServletRequest request)
{
Employee e= new Employee ();
e.setName("Мегафон Игры");
return JsonUtil.jsonStringify(e); //it converts object to json using JsonObjectMapper
}
}
2条答案
按热度按时间vom3gejh1#
我在我的机器上试过了,它工作了
我收到的:
olmpazwi2#
它帮助我在响应头中设置编码: