コード例 #1
0
ファイル: Sml340Form.java プロジェクト: tmtkkwgch/hellogit
  /**
   * <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) {

      GSValidateSmail.validateTextBoxInput(
          errors,
          conditionText,
          "conditionText" + condition,
          textCondition,
          GSConstSmail.MAXLEN_CONDITION_KEYWORD,
          true);
    }
    errSize = errors.size();
    return errSize;
  }
コード例 #2
0
ファイル: Sml340Form.java プロジェクト: tmtkkwgch/hellogit
  /**
   * <br>
   * [機 能] 入力チェックを行う <br>
   * [解 説] <br>
   * [備 考]
   *
   * @param req リクエスト
   * @throws Exception 実行例外
   * @return エラー
   */
  public ActionErrors validateCheck(HttpServletRequest req) throws Exception {
    ActionErrors errors = new ActionErrors();

    // フィルター名入力チェック
    GSValidateSmail.validateTextBoxInput(
        errors,
        sml340FilterName__,
        "sml340FilterName",
        getInterMessage(req, GSConstSmail.TEXT_FILTER),
        GSConstSmail.MAXLEN_SEARCH_KEYWORD,
        true);

    // 条件未選択
    if (sml340condition1__ == null
        && sml340condition2__ == null
        && sml340condition3__ == null
        && sml340condition4__ == null
        && sml340condition5__ == null
        && sml340tempFile__.equals("0")) {
      String msgKey = "error.select.required.text";
      ActionMessage msg =
          new ActionMessage(msgKey, getInterMessage(req, GSConstSmail.TEXT_CONDITION));
      StrutsUtil.addMessage(errors, msg, "wml230condition." + msgKey);
    }

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

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