aspose file tools*
The moose likes Struts and the fly likes Struts2 - if tag - OR condition Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2 - if tag - OR condition" Watch "Struts2 - if tag - OR condition" New topic
Author

Struts2 - if tag - OR condition

Vamshi Jampala
Ranch Hand

Joined: Feb 23, 2008
Posts: 40


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

Joined: Feb 23, 2008
Posts: 40


got rid of '' for 1 and 2 and it works
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Feb 23, 2008
Posts: 40
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts2 - if tag - OR condition