Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Short circuit operator for JSF(P) EL

Are there short circuit operators for Expression Language used in JSF, JSP?

I mean &&,|| Java analog,when if it's obvious that further evaluation of boolean has no sense, that evaluation is stopped.

I observed usage of and, or operators and looks like they're not short circuit.

like image 208
sergionni Avatar asked Feb 25 '23 13:02

sergionni


1 Answers

It are definitely short circuit operators.

#{bean.left or bean.right}

The right hand won't be evaluated when the left hand evaluates true.

#{bean.left and bean.right}

The right hand won't be evaluated when the left hand evaluates false.

like image 143
BalusC Avatar answered Feb 27 '23 03:02

BalusC