Ejemplo n.º 1
0
  /**
   * <br>
   * [機 能] 条件の入力チェックを行う <br>
   * [解 説] <br>
   * [備 考]
   *
   * @param condition 条件No
   * @param conditionText 条件テキスト
   * @param errSize エラーサイズ
   * @param errors ActionErrors
   * @param textCondition テキスト条件
   * @return エラー数
   */
  public int conditionCheck(
      String condition,
      String conditionText,
      int errSize,
      ActionErrors errors,
      String textCondition) {

    // 条件
    if (condition != null) {

      GSValidateWebmail.validateTextBoxInput(
          errors,
          conditionText,
          "conditionText" + condition,
          textCondition,
          GSConstWebmail.MAXLEN_CONDITION_KEYWORD,
          true);
    }
    errSize = errors.size();
    return errSize;
  }
Ejemplo n.º 2
0
  /**
   * <br>
   * [機 能] 入力チェックを行う <br>
   * [解 説] <br>
   * [備 考]
   *
   * @param req リクエスト
   * @throws Exception 実行例外
   * @return エラー
   */
  public ActionErrors validateCheck(HttpServletRequest req) throws Exception {
    ActionErrors errors = new ActionErrors();

    // フィルター名入力チェック
    GSValidateWebmail.validateTextBoxInput(
        errors,
        wml230FilterName__,
        "wml230FilterName",
        getInterMessage(req, GSConstWebmail.TEXT_FILTER),
        GSConstWebmail.MAXLEN_SEARCH_KEYWORD,
        true);

    // 条件未選択
    if (wml230condition1__ == null
        && wml230condition2__ == null
        && wml230condition3__ == null
        && wml230condition4__ == null
        && wml230condition5__ == null
        && wml230tempFile__.equals("0")) {
      String msgKey = "error.select.required.text";
      ActionMessage msg =
          new ActionMessage(msgKey, getInterMessage(req, GSConstWebmail.TEXT_CONDITION));
      StrutsUtil.addMessage(errors, msg, "wml230condition." + msgKey);
    }

    // 条件チェック
    validateCondition(errors, req);

    // 転送先メールアドレスチェック
    if (!(wml230actionSend__.equals("0"))) {
      List<String> addressList = new ArrayList<String>();
      for (int sendNo = 0; sendNo < wml230actionSendValue__.length; sendNo++) {
        String fwAddress = wml230actionSendValue__[sendNo];
        boolean errorFlg =
            GSValidateWebmail.validateMailTextBoxInput(
                errors,
                fwAddress,
                "wml230actionSendValue" + sendNo,
                getInterMessage(req, GSConstWebmail.TEXT_FORWARDADRESS) + (sendNo + 1),
                GSConstWebmail.MAXLEN_CONDITION_KEYWORD,
                true);

        // 重複チェック
        if (!errorFlg) {
          int dupIndex = addressList.indexOf(fwAddress);
          if (dupIndex >= 0) {
            String msgKey = "error.select.dup.list2";
            String[] msgParam = {
              getInterMessage(req, GSConstWebmail.TEXT_FORWARDADRESS) + (sendNo + 1),
              getInterMessage(req, GSConstWebmail.TEXT_FORWARDADRESS) + (dupIndex + 1)
            };
            ActionMessage msg = new ActionMessage(msgKey, msgParam);
            StrutsUtil.addMessage(errors, msg, "wml230actionSendValue." + sendNo + msgKey);
          }
          addressList.add(fwAddress);
        }
      }
    }

    // ラベル選択チェック
    if (wml230actionLabel__.equals("1") && wml230actionLabelValue__.equals("-1")) {
      String msgKey = "error.select.required.text";
      ActionMessage msg =
          new ActionMessage(msgKey, getInterMessage(req, GSConstWebmail.TEXT_SEL_LABEL));
      StrutsUtil.addMessage(errors, msg, "wml230selLabel." + msgKey);
    }
    return errors;
  }