V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
shaoxikai
V2EX  ›  问与答

fastjson 中$ref 对象重复引用问题,使用下面的 SerializerFeature.DisableCircularReferenceDetect 出现异常

  •  
  •   shaoxikai · 2017-04-23 20:42:15 +08:00 · 2107 次点击
    这是一个创建于 2595 天前的主题,其中的信息可能已经有所发展或是发生改变。

    我使用 public void writeJson(Object object) { try { String json = JSON.toJSONStringWithDateFormat(object, "yyyy-MM-dd HH:mm:ss",SerializerFeature.DisableCircularReferenceDetect); ServletActionContext.getResponse().setContentType( "text/html;charset=utf-8"); ServletActionContext.getResponse().getWriter().write(json); ServletActionContext.getResponse().getWriter().flush(); ServletActionContext.getResponse().getWriter().close(); } catch (IOException e) { e.printStackTrace(); } }

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2579 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 07:36 · PVG 15:36 · LAX 00:36 · JFK 03:36
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.