ssh 控制层返回json数据方法

public void writeJson(Object object) {   try {      String json = JSON.toJSONStringWithDateFormat(object, "yyyy-MM-dd HH:mm:ss");      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();   }}
相关文章
相关标签/搜索