日期:2014-05-16  浏览次数:20352 次

json窗体 .
var url=urlPath+"/vehicle/insurance/xzsbssx.jsp?readonly=" + $pick(readonly, "true");
var retValue=window.showModalDialog(url,window,"dialogWidth:45;dialogHeight:15;center:yes;status:'no'");







后台

JsonObject jsonObject=new JsonObject();
  jsonObject.add("returnVlue", policyForViewBean.toJsonElement());
  GsonBuilder builder=new GsonBuilder();
  String returnVlue=builder.create().toJson(jsonObject);
  //request.setAttribute("returnVlue", returnVlue);
  PrintWriter out = null;
  try {
   out = response.getWriter();
   out.print(returnVlue);
   log.debug(returnVlue);
  } catch (Exception e) {
   log.error("获取Writer错误!", e);
   throw new CommonException(ErrorConstants.SERVICE_ERROR, ErrorConstants.S_INTEGRATION_ERROR, "系统错误!");
  } finally {
   if (out != null) {
    out.flush();
    out.close();
   }
  }



var returnVlue= eval('(' +returnVlue + ')').returnVlue;



结果为returnVlue