• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts2 - if tag - OR condition

 
Vamshi Jampala
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


There is some thing wrong with the S:IF which I am not aware of, please let me know if you know what is wrong here.

Thank you for your time
 
Vamshi Jampala
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


got rid of '' for 1 and 2 and it works
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, if they're not strings, shouldn't be quoted. And if they *are* strings, see:

http://struts.apache.org/2.x/docs/why-wont-the-if-tag-evaluate-a-one-char-string.html
 
Vamshi Jampala
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:Yeah, if they're not strings, shouldn't be quoted. And if they *are* strings, see:

http://struts.apache.org/2.x/docs/why-wont-the-if-tag-evaluate-a-one-char-string.html


OGNL : Another interesting thing

Note: For any of the tags that use lists (select probably being the most ubiquitous), which uses the OGNL list
notation (see the "months" example above), it should be noted that the map key created (in the months example,
the '01', '02', etc.) is typed. '1' is a char, '01' is a String, "1" is a String. This is important since if
the value returned by your "value" attribute is NOT the same type as the key in the "list" attribute, they
WILL NOT MATCH, even though their String values may be equivalent. If they don't match, nothing in your list
will be auto-selected.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic