Uploaded image for project: 'Cubby'
  1. Cubby
  2. CUBBY-224

アクション内でフォームオブジェクトにnullを設定してもリクエストパラメータが優先される

XMLWordPrintable

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major Major
    • 2.0.0-beta2
    • Affects Version/s: 2.0.0-beta1
    • Component/s: None
    • None

      バリデーションエラーでない場合もリクエストパラメータから値を復元しようとしているのが問題。
      以下のコメントアウトで期待する動作になるようです。

      	public static Object formValue(final JspContext context,
      			final String[] outputValues, final String name,
      			final Integer index, final Object specifiedValue) {
      		final Object value;
      
      		if (isValidationFail(context)) {
      			if (specifiedValue == null) {
      				final Object[] values = paramValues(context, name);
      				value = value(values, index);
      			} else {
      				final Object[] values = paramValues(context, name);
      				if (values.length == 0) {
      					value = specifiedValue;
      				} else {
      					value = value(values, index);
      				}
      			}
      		} else {
      			if (specifiedValue != null) {
      				value = specifiedValue;
      //			} else if (outputValues == null) {
      //				final Object[] values = paramValues(context, name);
      //				value = value(values, index);
      			} else {
      				value = value(outputValues, index);
      			}
      		}
      
      		return value;
      	}
      

            Assignee:
            baba baba
            Reporter:
            agata agata
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: