Re: struts2 ognl confusion

2009-08-06 Thread musomesa
@struts.apache.org Sent: Wed, Aug 5, 2009 1:41 pm Subject: Re: struts2 ognl confusion questionId is just a string. so dont think its equals or hash problem. wes, what you suggested I've put that in place and testing to see if error comes again. On Wed, Aug 5, 2009 at 1:35 PM, musom

struts2 ognl confusion

2009-08-05 Thread Bhaarat Sharma
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

Re: struts2 ognl confusion

2009-08-05 Thread Wes Wannemacher
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

Re: struts2 ognl confusion

2009-08-05 Thread Bhaarat Sharma
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

Re: struts2 ognl confusion

2009-08-05 Thread Bhaarat Sharma
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

Re: struts2 ognl confusion

2009-08-05 Thread Chris Pratt
You must be using a fairly old version of Struts 2. The difference between the ${} and the # versions is that the ${} is a JSTL EL expression that is no longer allowed inside struts (s:) tags for security reasons. The # version is OGNL and references the variable that Wes tried to define. Try

Re: struts2 ognl confusion

2009-08-05 Thread Bhaarat Sharma
thanks for the explanation chris. but using what you suggested is not making Print Something appear even once. so the test statement is never evaluated to true. ...leading me to suspect that ognl expression is not working. I am not sure whether the random error that is happening for us is being

Re: struts2 ognl confusion

2009-08-05 Thread Bhaarat Sharma
looks like it is not working only in contains.I tried the following: s:iterator value=questions status=status id=question s:if test='%{incorrectQs.contains(#question.questionId)}' div style=color: red; padding-bottom: 5px;Print Something/div /s:if s:else

Re: struts2 ognl confusion

2009-08-05 Thread mailtolouis2020-struts
: struts2 ognl confusion You must be using a fairly old version of Struts 2. The difference between the ${} and the # versions is that the ${} is a JSTL EL expression that is no longer allowed inside struts (s:) tags for security reasons. The # version is OGNL and references the variable that Wes tried

Re: struts2 ognl confusion

2009-08-05 Thread Bhaarat Sharma
Users Mailing List user@struts.apache.org Sent: Wednesday, August 5, 2009 4:54:31 PM Subject: Re: struts2 ognl confusion You must be using a fairly old version of Struts 2. The difference between the ${} and the # versions is that the ${} is a JSTL EL expression that is no longer allowed

Re: struts2 ognl confusion

2009-08-05 Thread Wes Wannemacher
I would try to fiddle around with incorrectQs to see why .contains isn't working... I'm guessing that if you iterate both lists, although not efficient, you might get better results - s:iterator value=questions id=question s:iterator value=incorrectQs id=incorrectQ s:if test='%{#incorrectQ ==

Re: struts2 ognl confusion

2009-08-05 Thread musomesa
what type is questionId? You might have a problem with the equals() in it. Chris -Original Message- From: Wes Wannemacher w...@wantii.com To: Struts Users Mailing List user@struts.apache.org Sent: Wed, Aug 5, 2009 1:09 pm Subject: Re: struts2 ognl confusion I would

Re: struts2 ognl confusion

2009-08-05 Thread Bhaarat Sharma
() in it. Chris -Original Message- From: Wes Wannemacher w...@wantii.com To: Struts Users Mailing List user@struts.apache.org Sent: Wed, Aug 5, 2009 1:09 pm Subject: Re: struts2 ognl confusion I would try to fiddle around with incorrectQs to see why .contains isn't working

Re: struts2 ognl confusion

2009-08-05 Thread Chris Pratt
Subject: Re: struts2 ognl confusion You must be using a fairly old version of Struts 2. The difference between the ${} and the # versions is that the ${} is a JSTL EL expression that is no longer allowed inside struts (s:) tags for security reasons. The # version is OGNL and references