@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
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
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
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
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
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
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
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
: 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
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
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 ==
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
() 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
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
14 matches
Mail list logo