2
gspファイルの必須フィールドのエラーメッセージをカスタマイズして、beanフィールド名を表示せずにgspのフィールドラベルを表示する方法は?Grailsのエラーメッセージ(ラベルgspに基づく)
だから私はこのように豆を持っている場合:
<field:wrapper bean="${bean}" field="fieldName">
<field:label field="${field}" code="reconfirmationForm.${field}.label" required="true" />
<g:select name="${field}" value="${fieldValue(bean: bean, field: field)}" from="[true, false]" valueMessagePrefix="default.booleanSelectLabel" noSelection="['': '']" />
<field:errors bean="${bean}" field="${field}" />
</field:wrapper>
そして、私が持っている性質で:
メッセージ持つ方法default.blank.message={0} is required
reconfirmationForm.fieldName.label=My super field
:
をこのようなclass Bean {
int number
}
とフィールド
My super field is required
そしてません:
number is required
私はパターンがあり、あなたのmessage.properties
bean.number.blank = My super field is required
に(だけではなく、数のため)フィールド毎
ありがとうございます。しかし、あなたが言及したように私はより一般的な何かを探しています。 –