在EL表达式中使用多个布尔条件 [英] Using multiple boolean conditions in EL expression

查看:517
本文介绍了在EL表达式中使用多个布尔条件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何在EL中组合多个布尔条件. 我有以下示例,但它不起作用.

I would like to know how can I combine multiple boolean coniditions in EL. I have following example and it is not working.

<x:someComponent rendered="#{bean.condition1} or #{bean.condition2}">

如何在EL中使用或"和与"逻辑运算符?

How can I use "OR" and "AND" logical operators in EL?

推荐答案

运算符必须放在EL表达式内部,而不是外部.您应该将#{...}视为一个大范围,其中各种变量/条件相互影响.

The operator has to go inside the EL expression, not outside. You should see the #{...} as one big scope wherein various variables/conditions interact with each other.

<x:someComponent rendered="#{bean.condition1 or bean.condition2}">

另请参见:

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆