Im trying to display a simple table with an @Entity infos using the following tag-libs:
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
Here's the mapped entity attribute, a boolean:
@NotNull
@Column(name = "ACTIVE", columnDefinition = "BIT", length = 1)
private boolean active;
//... getters and setters
public boolean getActive() {
return active;
}
public boolean isActive() {
return active;
}
public void setActive(boolean active) {
this.active= active;
}
ps.: by debugging the backing bean, im getting the desired list.
Here's my .xhtml (jsf page) snippet:
<ui:repeat var="u" value="#{usersList}">
<tr>
<td>#{u.name}</td>
<td>#{u.login}</td>
<td>#{u.email}</td>
<td>
<c:choose>
<c:when test="${u.active}">
<span style="color: green" class="glyphicon glyphicon-ok"></span>
</c:when>
<c:otherwise>
<span style="color: red"
class="glyphicon glyphicon-remove"></span>
</c:otherwise>
</c:choose>
</td>
</tr>
</c:when>
</ui:repeat>
Altough the list is not empty, the empty message is being shown, and no row is displayed.
If i force the row displaying, removing the conditional rendering, i get the following error:
java.lang.IllegalArgumentException: Cannot convert 1 of type class java.lang.Long to class java.lang.Boolean
for the property active.
I've tried a few solutions before asking, like these:
How does Java expression language resolve boolean attributes? (in JSF 1.2)
javax.el.PropertyNotFoundException when trying to resolve Boolean properties in EL
Update 1: reviewing my code, i realised i was empty testing an object, not a list, updating my snippet also, so, the conditional on the rows displaying its ok now, but the active property issue, still throwing the error.