can we code the following if condi开发者_StackOverflowtion inside the <c:if test="${}
> ?
if((myFlag == true) && (flag1 != null || flag2 != null || flag3 != null))
Sure:
<c:if test="${myFlag and (not empty flag1 or not empty flag2 or not empty flag3)}">
PS: Using a null
-test to decide a flag instead of true
/false
is bad style and should be avoided, if possible.
<c:if test="${myFlag && (flag1 != null || flag2 != null || flag3 != null)}">
Simple, isn't it?
See http://java.sun.com/products/jsp/syntax/2.0/syntaxref207.html#1010522 for a reference
精彩评论