lundi 6 avril 2015

how to hide/display field option for user's record in spring

below is the code which I am using in my jsp



<option value="" disabled selected>--Select--</option>
<c:forEach items="${users}" var="user" varStatus="status">
<option value="${user.userId}"><c:out
value="${user.userName}"></c:out>
</option>
</c:forEach>
<option value="-1">All</option>
</select>

<c:forEach items="${expenseList}" var="list" varStatus="status">
<tr>
<td><input type="checkbox" name="check" id="check"
value="${list.expenseId}" class="case"></td>
<td>${list.itemDescription}</td>
<td>${list.amount}</td>
<td>${list.expenseDate}</td>
</tr>
</c:forEach>


so whenever a user selects All option from the dropdown then he will be able to see the records for all the registered user but the checkbox option will only be available against his records and not for other registered user. but if a logged in user is admin then that checkbox option should be available against all the records... So please help me on how to achieve it in spring or spring security


Aucun commentaire:

Enregistrer un commentaire