예제 #1
0
  public void render(HttpServletRequest req, HttpServletResponse resp, Object obj)
      throws IOException {

    if (resp.getContentType() == null)
      if (jsonp) resp.setContentType(JSONP_CT);
      else resp.setContentType(CT);
    Writer writer = resp.getWriter();
    if (jsonp) writer.write(req.getParameter(jsonpParam == null ? "callback" : jsonpParam) + "(");
    Mvcs.write(resp, writer, null == obj ? data : obj, format.clone());
    if (jsonp) writer.write(");");
  }
예제 #2
0
 public void render(HttpServletRequest req, HttpServletResponse resp, Object obj)
     throws IOException {
   Mvcs.write(resp, null == obj ? data : obj, format);
 }