不用@RestController如何返回json

resp.setContentType("application/json;charset=utf-8");
resp.getWriter().write(new ObjectMapper().writeValueAsString(authentication.getPrincipal()));

posted on 2020-11-11 23:00  我欲皆真  阅读(590)  评论(3编辑  收藏  举报

导航