2011-05-24 30 views
1

我想在我的JSP取決於是否有錯誤或者沒有在我的JSP有條件地做一些事情,像我怎樣才能春天錯誤計數在JSP

<c:choose> 
    <c:when test="${errors.errorCount > 0}"> 
     <!-- do something --> 
    </c:when> 
</c:choose> 

然而,它始終計算作爲錯誤,即使有錯誤也是如此。

評估此問題的正確方法是什麼?

+1

你看到了嗎? http://stackoverflow.com/questions/5259194/cant-get-any-output-from-the-springhasbinderrors-taglib/5259325#5259325 – 2011-05-24 04:20:16

回答

0

你需要把這個在spring:bind標籤與正確的name屬性爲它填充${errors}

<spring:bind name="yourstuff"> 
... 
</spring:bind>