与根本原因javax.el.E​​LException:

时间:2013-03-13 10:14:43

标签: jsp jsp-tags

我的jsp页面中有以下代码

 <a href="javascript:void(0)" style="<c:if test="${fn:length(page.likes)}">display:none</c:if>" class="like">Like</a>&nbsp;

我收到以下异常

javax.el.ELException: Cannot convert 1 of type class java.lang.Integer to class java.lang.Boolean
org.apache.el.lang.ELSupport.coerceToBoolean(ELSupport.java:207)
org.apache.el.lang.ELSupport.coerceToType(ELSupport.java:402)

1 个答案:

答案 0 :(得分:2)

答案是

 <c:if test="${(fn:length(page.likes))==0}">   :)