in EL expression in JSP we can use ${"1"+"2"}
but not ${"Dark"+"Knight"}
. Why?
The JSP 2.1 (2006) spec defines +
as an arithmetic operator only, so it cannot be used for string concatenation. "1"
and "2"
are coerced to numerical types according to the rules for coercion, so ${"1"+"2"}
will evaluate to 3
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With