I am new to
struts and I am trying to learn logic:interate.
I am trying make changes to the following code.
<logic:iterate name="testDateStrList" id="testDate">
<p>
List Messages <bean:write name="testDate"/>
</p>
</logic:iterate>
I created this on my action
String myDate = "01/01/2013";
request.setAttribute("myDate",myDate);
on my
jsp I want to
test the arraylist value with my object.
I know that the logic:iterate works with an arraylist. However can
it work with an object to perform a comparison?
<logic:iterate name="testDateStrList" id="testDate">
<p>
List Messages <bean:write name="testDate"/>
</p>
<C:if test="${testDate == myDate}">
<h2>hey the daate is <c:out value="${testDate}"/></h2>
</C:if>
</logic:iterate>
In this example it passes the if statement no matter what.
My results.... Not sure what the if statement is comparing.
This (testDate == myDate) should be 2 string . I am not sure
List Messages 01/10/2013
hey the daate is 01/10/2013
List Messages 07/01/2013
hey the daate is 07/01/2013
List Messages 06/18/2013
hey the daate is 06/18/2013
List Messages 01/01/2013
hey the daate is 01/01/2013
List Messages 06/19/2013
hey the daate is 06/19/2013