Compare two ArrayList:
1.ArrayList are ListOfData and SecondList
2.Include this tag in the JSP Page
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
3.Find the Length of the ArrayList Using fn:length tag
4.Compare the ArrayList as
<c:if test=”${not empty ListOfData}” >
<c:forEach var=”j” begin=”0″ end=”${fn:length(SecondList)-1}”>
<c:forEach var=”i” begin=”0″ end=”${fn:length(ListOfData)-1}”>
<c:forEach var=”j” begin=”0″ end=”${fn:length(SecondList)-1}”>
<c:forEach var=”i” begin=”0″ end=”${fn:length(ListOfData)-1}”>
<tr>
<c:if test=”${SecondList[j].empid==ListOfData[i].empid}”>
<td>${ListOfData[i].empid} </td>
<td>${ListOfData[i].empname} </td>
<td>${ListOfData[i].empdest} </td>
</c:if>
</tr>
</c:forEach>
</c:forEach>
</c:if>
Popularity: 4% [?]
Related posts:

November 2nd, 2008
admin
Posted in 
