-1

In the official docs: https://commons.apache.org/proper/commons-ognl/language-guide.html

there is an explanation for in operator:
The in operator (and not in, its negation). This is a containment test, to see if a value is in a collection. For example,
name in {null,"Untitled"} || name

I'm unable to understand this expression but quite intrigued by it.
It checks whether name is null or "Untitled". If it's not then it returns name instead of a boolean value, am I right?

Shah-G
  • 652
  • 1
  • 8
  • 22

1 Answers1

0

The behavior of this OGNL expression is weird.
It returns true if name is either null or "Untitled" otherwise it returns the value of name if used in a property tag. If used in a if tag then it evaluates to true only if the values of name are either null or "Untitled".
But I wonder what may be a use of such an expression?

Shah-G
  • 652
  • 1
  • 8
  • 22