开发者社区> 问答> 正文

ajax请求spring mvc Controller返回的json中的引号被转义

UserShowDto showDto = new UserShowDto(show);
//JSONObject json = JSONObject.fromObject(showDto);
map.put("status", SystemConstants.SYSTEM_SUCCESS);
//JSONObject jo = new JSONObject();
//jo.put("name","mical");
map.put("showDto", showDto);
System.out.println(map);
//String str = "'hello'";
//System.out.println(json);
return map;
success : function (result){
var str = JSON.stringify(result);
lert(str);

screenshot

展开
收起
a123456678 2016-03-17 16:10:21 6734 0
1 条回答
写回答
取消 提交回答
  • @RequestMapping("/ajaxCreateShow") @ResponseBody public Map<String,Object> ajaxCreateShow(HttpServletRequest request,HttpServletResponse response){}
    2019-07-17 19:05:35
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
云栖社区特邀专家徐雷Java Spring Boot开发实战系列课程(第20讲):经典面试题与阿里等名企内部招聘求职面试技巧 立即下载
微服务架构模式与原理Spring Cloud开发实战 立即下载
阿里特邀专家徐雷Java Spring Boot开发实战系列课程(第18讲):制作Java Docker镜像与推送到DockerHub和阿里云Docker仓库 立即下载

相关实验场景

更多