struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bhaarat Sharma <bhaara...@gmail.com>
Subject struts2 ognl confusion
Date Wed, 05 Aug 2009 15:35:50 GMT
I have the following code in a jsp
Line1: <s:iterator value="questions" status="status">
Line2:    <s:if test='incorrectQs.contains("${questionId}")'>
Line3:        <div style="color: red; padding-bottom: 5px;">Print
Something</div>
Line4:    </s:if>
Line5:</s:iterator>

On Line1 questions is a list.  This list contains object of class Exam.
Class Exam has a getter/setter questionId
On Line2 incorrectQs is a list.  This list contains strings.

I am checking to see if list in Line2 contains a questionId that is in
questions list on line1.

Is this the best way to do this?

the code seems to be working but 'randomly' sometimes Line2 never seems to
be true ...when we know it IS true.

I just want to make sure with some experienced people whether this is the
way to achieve this?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message