shaoxikai
V2EX  ›  问与答

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

  •  
  •   shaoxikai · Apr 23, 2017 · 2761 views
    This topic created in 3346 days ago, the information mentioned may be changed or developed.

    我使用 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(); } }

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3552 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 10:41 · PVG 18:41 · LAX 03:41 · JFK 06:41
    ♥ Do have faith in what you're doing.