oh and attribute 'var' seems to be invalid according to the TLD On Wed, Aug 5, 2009 at 11:42 AM, Bhaarat Sharma <bhaara...@gmail.com> wrote:
> ok thanks Wes. yeah that is def. more readable. > could you please tell me what the difference is in doing > <s:if test='incorrectQs.contains("${questionId}")'> > VS. > <s:if test='incorrectQs.contains(#question.questionId)'> > > beside the question.questionId part. I am more concerned about difference > in '$' vs. '#' > > > On Wed, Aug 5, 2009 at 11:39 AM, Wes Wannemacher <w...@wantii.com> wrote: > >> I think this would be more readable - >> >> <s:iterator value="questions" status="status" var="question"> >> <s:if test='incorrectQs.contains(#question.questionId)'> >> <div style="color: red; padding-bottom: 5px;">Print >> Something</div> >> </s:if> >> </s:iterator> >> >> -Wes >> >> On Wed, Aug 5, 2009 at 11:35 AM, Bhaarat Sharma<bhaara...@gmail.com> >> wrote: >> > 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? >> > >> >> >> >> -- >> Wes Wannemacher >> >> Head Engineer, WanTii, Inc. >> Need Training? Struts, Spring, Maven, Tomcat... >> Ask me for a quote! >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> For additional commands, e-mail: user-h...@struts.apache.org >> >> >