如何在JSTL中对此结构进行编码?

时间:2011-08-23 19:02:49

标签: jsp jstl el

我们可以在<c:if test="${}&gt;内的条件下编码以下内容吗? ?

if((myFlag == true) && (flag1 != null || flag2 != null || flag3 != null))

2 个答案:

答案 0 :(得分:2)

不确定

<c:if test="${myFlag and (not empty flag1 or not empty flag2 or not empty flag3)}">

PS:使用null - 测试来确定标志而不是true / false是不好的风格,如果可能的话应该避免。

答案 1 :(得分:1)

<c:if test="${myFlag && (flag1 != null || flag2 != null || flag3 != null)}">
简单,不是吗?

请参阅http://java.sun.com/products/jsp/syntax/2.0/syntaxref207.html#1010522以获取参考资料

相关问题