tags:

views:

784

answers:

0

I have the following code which does not seem to work. I fail to see why this wont work.

<s:iterator value=%{questions} id="question">
   <s:if test='%{incorrectQs.contains("#question.questionId")}'>
      Print something here
   </s:if>
</s:iterator>

In the above code, basically I have a method called getQuestions in the action class. This list contains objects of Exam class which has a get/set questionId. I also have incorrectQs list which contains strings. I am checking if incorrectQs contains a questionId. if it does i want to print some text. Eventhough, the above code does not work, the code below works fine randomly. Sometimes it works and sometimes it does not...:(

<s:iterator value=%{questions}>
   <s:if test='%{incorrectQs.contains("${questionId}")}'>
      Print something here
   </s:if>
</s:iterator>

can anyone provide some insight in this?