<form:errors>块只显示非字段错误?</form:errors>

时间:2011-07-28 12:36:29

标签: java jsp spring-mvc

是否可以配置仅显示非字段错误的<form:errors/>元素?

我尝试了以下内容,但当然它列出了所有错误字段和非字段。

<resource:hasBindErrors name="dualEntryForm">
    <div class="errorText">Please correct the following errors:</div>
    <div class="errorText"><form:errors path="*" cssClass="errorBox" /></div>
</resource:hasBindErrors>

是否存在未显示字段错误的路径表达式?

1 个答案:

答案 0 :(得分:3)

您是否尝试过省略form:errors path属性?

<resource:hasBindErrors name="dualEntryForm">
    <div class="errorText">Please correct the following errors:</div>
    <div class="errorText"><form:errors cssClass="errorBox" /></div>
</resource:hasBindErrors>
相关问题