0
我有一個struts2驗證的大問題。 它在我的大部分領域工作良好,但不在我的長場。Struts2驗證問題 - 沒有顯示正確的消息
如果我在長字段中輸入一個字符串,它將顯示英文消息而不是我的消息聲明。
字段「borrower.matNo」的字段值無效。
在我的messages_de.properties它說: exception.borrowerMatNo = Bitte geben Sie eine Nummer als Matrikelnummer an。
來自驗證xml。 (有正確的名稱,一百次檢查)
<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.2//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
<validators>
<field name="borrower.matNo">
<field-validator type="int">
<param name="min">1</param>
<param name="max">100000</param>
<message key="exception.borrowerMatNo"/>
</field-validator>
</field>
</validators>
從JSP
<s:textfield key="borrower.matNo" />
<s:submit key="search" />
</s:form>
perfetktly – user2182326