本文介绍了在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}">另请参见:
- 我们的EL Wiki页面
- 有条件地显示JSF组件
- 如何有条件地呈现纯HTML元素,例如< div> ; s?
- Our EL wiki page
- Conditionally displaying JSF components
- How to conditionally render plain HTML elements like <div>s?
See also:
更多推荐
在EL表达式中使用多个布尔条件
发布评论