I am working on Java web application where I am populating 2 beans by setting up JDBC with my database. I use JSP to view the pages and I am getting proper results in form of tables. One of my table have data about drivers and passengers. The bean is being populated with the entire data. Now I need to utilize JSTL tags to only view the drivers details. So I wrote the following chunk of codes in JSP. I think I am having some problem with the if tag. When I remove it I get the answer but it includes both drivers and passengers. Any suggestions..
<table width="100%" cellpadding = "2" cellspacing = "0" border= "0">
<c:forEach items='${detailBean.personBean}' var='person' varStatus='status'>
<c:if test='${person.role=='DRIVER' }'>
<tr><td nowrap width = "10%" align="right"><c:out value="VEHNO: " /> </td> <td nowrap align="left"> <c:out value='${person.vehNo}'/></td></tr>
<tr><td nowrap width = "10%" align="right"><c:out value="ROLE: " /></td> <td nowrap align="left"> <c:out value='${person.role}'/></td></tr>
<tr><td nowrap width = "10%" align="right"><c:out value="DRVRFLAG: " /></td> <td nowrap align="left"> <c:out value='${person.drvrFlag}'/></td></tr>
</c:if>
</c:forEach>
</table>