| Author |
Is my use of c:if correct ?
|
surendar prabu
Ranch Hand
Joined: Jul 24, 2006
Posts: 102
|
|
I am using JSTL c:if to compare values of two properties. But i dont find any difference in the outout. some one pls help me on this. i have given the code below. If this cannot work, then i will go for adding a method to my Action Form which returns me a boolean. <logic:iterate property="collection1" id="collection" name="MyForm"> <td><bean:write name="collection" property="property1"/></td> <c:if test="${MyForm.property4 == collection.property2}"> <td><bean:write name="collection" property="property2"/></td> </c:if> <td><bean:write name="collection" property="property3"/></td> </logic:iterate> Here i have a property4 in my ActionForm MyForm and some properties in the bean reperesented by collection. Now if property4 of MyForm and property2 of collection are equal then only i should draw the 'td' field. But irrespective of any condition i am getting the output. Should I use c:forEach instead of struts logic? please help me on this regard. regards, Surendar prabu.
|
SCJP 1.4
|
 |
Purushoth Thambu
Ranch Hand
Joined: May 24, 2003
Posts: 425
|
|
Try something like this [ March 03, 2007: Message edited by: Purushothaman Thambu ]
|
 |
 |
|
|
subject: Is my use of c:if correct ?
|
|
|