I have this behaviour I do not really understand
${someVar}
${someVar.class.name}
${someVar == 'error'}
outputs
false
java.lang.Boolean
true
- How can it be exlpained?
- What it the correct way to write the test in order to first test if the two ‘things’ have the same type and then if their value is the same?
This is the behaviour of the language as defined in the EL specification:
So, the string literal is coerced to a boolean via
Boolean.valueOf("error")which returns false.