这种情况怎么办?

<c:if test="${not empty userList)}">
    <table cellpadding="5">
        <tr class="even">
            <th>Name</th>
            <th>Gender</th>
            <th>Country</th>
            <th>About You</th>
        </tr>
        <c:forEach items="${userList}" var="user" varStatus="status">
            <tr class="<c:if test="${status.count % 2 == 0}">even</c:if>">
                <td>${user.name}</td>
                <td>${user.gender}</td>
                <td>${user.country}</td>
                <td>${user.aboutYou}</td>
            </tr>
        </c:forEach>
    </table>
</c:if>
当我删除
<c:if test="${not empty userList)}"></c:if>
它会引发我错误。 这个条件检查什么?我的数据库表有用户列表,但是这整个代码并没有显示在我的HTML本身中。     
已邀请:
那条线相当于
if(userList!=null && userList.size()>0)
    
它检查列表是否包含数据,如果可以,则可以使用foreach。如果在空列表或空列表上使用foreach,则会抛出异常。     
  当我删除
<c:if test="${not empty userList)}"></c:if>
它会引发我错误。 这让我感到惊讶。我希望它反过来。当你删除那一行时,我希望错误消失。它在语法上是无效的。以下语法有效:
<c:if test="${not empty userList}">
在以后的问题中,请发布确切的错误消息和跟踪。他们就是说出问题的原因。你知道,一旦理解了某个问题的原因,那么解决方案就会说明问题。     

要回复问题请先登录注册