再次匹配。基本上我在用户浏览页面时检查角色。它的一个数组,可以说1,2,3。用于测试的jsp上最后一列的内容具有附加到每个单独附件的角色#。最后一栏不会是在成品上,但我需要做某种IF
该阵列上,看是否有数组中的值:JSTL检查一个数组中的值是否与第二个数组
<c:forEach items = "${hotPartRoles}" var = "hpRole">
${hpRole.id}
</c:forEach>
是连接角色的数组中:
<c:forEach items = "${item.roles}" var = "role">
${role.id}
</c:forEach>
JSP:
<table class="data_table">
<tr>
<th>Attachments</th>
//These are the user's Roles
<c:forEach items = "${hotPartRoles}" var = "hpRole">
${hpRole.id}
</c:forEach>
</tr>
<tr>
<td class="subtable">
<table class="data_table">
<c:choose>
<c:when test='${empty attachList}'>
<tr>
<td>No Attachments</td>
</tr>
</c:when>
<c:otherwise>
<tr>
<th>Remove Attachment</th>
<th>File Name</th>
<th>File Type</th>
<th>File Size (bytes)</th>
<th>File Attached By</th>
<th>Date/Time File Attached</th>
<th>Roles</th>
</tr>
<c:forEach var="item" items="${attachList}" varStatus="loopCount">
<tr>
<td class="button">
<rbac:check operation="<%=Operation.DELETE%>">
<button type="button" onclick="javascript:delete_prompt(${item.id});">Delete</button>
</rbac:check>
</td>
<td><a href="show.view_hotpart_attachment?id=${item.id}">${item.fileName}</a></td>
<td>${item.fileType}</td>
<td><fmt:formatNumber value="${item.fileSize}" /></td>
<td>${item.auditable.createdBy.lastName}, ${item.auditable.createdBy.firstName}</td>
<td><fmt:formatDate value="${item.auditable.createdDate}" pattern="${date_time_pattern}" /></td>
<td>
<c:forEach items = "${item.roles}" var = "role">
${role.id}
</c:forEach>
</td>
</tr>
</c:forEach>
</c:otherwise>
</c:choose>
</table>
现在ONT需要精确匹配的阵列,只是用户角色的所述阵列中的值是固定角色的阵列中....
我需要在这里做检查,以determin是否把一个禁止标志上的“删除”按钮:
<rbac:check operation="<%=Operation.DELETE%>">
<button type="button" onclick="javascript:delete_prompt(${item.id});">Delete</button>
</rbac:check>
</td>
<td>
即时通讯思想也许2嵌套的循环 – 2012-03-16 14:55:37
' ' –
2012-03-16 14:55:53
不确定... ..... – 2012-03-16 14:56:23