Package org.g4studio.core.metatype

Examples of org.g4studio.core.metatype.Dto.toJson()


    if (G4Utils.isEmpty(userInfo)) {
      jsonDto.put("success", new Boolean(false));
      jsonDto.put("msg", "帐号输入错误,请重新输入!");
      jsonDto.put("errorType", "1");
      log.warn("帐户[" + account + "]登陆失败.(失败原因:不存在此帐户)");
      write(jsonDto.toJson(), response);
      return mapping.findForward("");
    }
    if (!password.equals(userInfo.getPassword())) {
      jsonDto.put("success", new Boolean(false));
      jsonDto.put("msg", "密码输入错误,请重新输入!");
View Full Code Here


    if (!password.equals(userInfo.getPassword())) {
      jsonDto.put("success", new Boolean(false));
      jsonDto.put("msg", "密码输入错误,请重新输入!");
      jsonDto.put("errorType", "2");
      log.warn(userInfo.getUsername() + "[" + userInfo.getAccount() + "]" + "登录系统失败(失败原因:密码输入错误)");
      write(jsonDto.toJson(), response);
      return mapping.findForward("");
    }
    String multiSession = WebUtils.getParamValue("MULTI_SESSION", request);
    if ("0".equals(multiSession)) {
      Integer sessions = (Integer) g4Reader.queryForObject("Organization.countHttpSessions", account);
View Full Code Here

        jsonDto.put("success", new Boolean(false));
        jsonDto.put("msg", "此用户已经登录,系统不允许建立多个会话连接!");
        jsonDto.put("errorType", "3");
        log.warn(userInfo.getUsername() + "[" + userInfo.getAccount() + "]"
            + "登录系统失败(失败原因:此用户已经登录,系统参数配置为不允许一个用户建立多个连接)");
        write(jsonDto.toJson(), response);
        return mapping.findForward("");
      }
    }
    userInfo.setSessionID(request.getSession().getId());
    userInfo.setSessionCreatedTime(G4Utils.getCurrentTime());
View Full Code Here

    if (!checkMultiUser(userInfo, request)) {
      jsonDto.put("success", new Boolean(false));
      jsonDto.put("msg", "不允许在同一客户端上同时以不同帐户登录系统,请先退出你已经登录的帐户后再尝试登录!");
      jsonDto.put("errorType", "1");
      log.warn("帐户[" + account + "]登陆失败.(失败原因:不允许在同一客户端上同时以不同帐户登录系统.请先退出你已经登录的帐户后再尝试登录)");
      write(jsonDto.toJson(), response);
      return mapping.findForward("");
    }
    super.getSessionContainer(request).setUserInfo(userInfo);
    log.info(userInfo.getUsername() + "[" + userInfo.getAccount() + "]" + "成功登录系统!创建了一个有效Session连接,会话ID:["
        + request.getSession().getId() + "]" + G4Utils.getCurrentTime());
View Full Code Here

    if (g4PHelper.getValue("requestMonitor", "0").equals("1")) {
      saveLoginEvent(userInfo, request);
    }
    jsonDto.put("success", new Boolean(true));
    jsonDto.put("userid", userInfo.getUserid());
    write(jsonDto.toJson(), response);
    return mapping.findForward("");
  }
 
  /**
   * 回写Cookie
 
View Full Code Here

   * @return
   * @throws IOException
   */
  protected void setOkTipMsg(String pMsg, HttpServletResponse response) throws IOException {
    Dto outDto = new BaseDto(G4Constants.TRUE, pMsg);
    write(outDto.toJson(), response);
  }
 
  /**
   *
   * 交易失败提示信息(特指:业务交易失败并不是请求失败)<br>
 
View Full Code Here

   * @return
   * @throws IOException
   */
  protected void setErrTipMsg(String pMsg, HttpServletResponse response) throws IOException {
    Dto outDto = new BaseDto(G4Constants.FALSE, pMsg);
    write(outDto.toJson(), response);
  }
 
  /**
   * 检查在演示环境下绕过前端控制提交数据的情况
   *
 
View Full Code Here

        + getServlet().getServletContext().getMinorVersion());
    outDto.put("g.JVM版本", System.getProperty("java.version"));
    outDto.put("h.JVM提供商", System.getProperty("java.vendor"));
    outDto.put("i.JVM安装路径", System.getProperty("java.home"));
    outDto.put("k.JVM可用最大内存", Runtime.getRuntime().maxMemory() / 1024 / 1024 + "M");
    request.setAttribute("jsonInfo", outDto.toJson());

    String caption = "JVM内存使用情况实时监控图(";
    caption = caption + "可分配总内存:" + new Double(Runtime.getRuntime().maxMemory() / 1024 / 1024).intValue() + "M ";
    caption = caption + "已分配总内存:" + new Double(Runtime.getRuntime().totalMemory() / 1024 / 1024).intValue() + "M ";
    caption = caption
View Full Code Here

      String result = outDto.getAsString("result");
      result = result + " " + inDto.getAsString("number1") + "+" + inDto.getAsString("number2") + "=" + outDto.getAsString("sum");
      outDto.put("result", result);
      outDto.put("success", new Boolean(true));
    outDto.put("msg", "存储过程调用成功");
    write(outDto.toJson(), response);
    return mapping.findForward(null);
  }
 
  /**
   * SQL语句批处理
 
View Full Code Here

   */
  public ActionForward formSynForwardInit(ActionMapping mapping, ActionForm form, HttpServletRequest request,
      HttpServletResponse response) throws Exception {
    BaseActionForm aForm = (BaseActionForm)form;
    Dto inDto = aForm.getParamAsDto(request);
    request.setAttribute("value", inDto.toJson());
    return mapping.findForward("formSynForwardPageView");
  }

  /**
   * 表单:接收表单提交数据
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.