Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

EL Complex Conditions

  Asked By: Bryant    Date: Apr 22    Category: Java    Views: 958
  

I am using the Apache JSTL library on my JSP pages. On one of them I
am using the "when" tag with a complex condition. The JSP specs don't
address complex conditions very well, so here I am. My JSTL tags:


<c:choose>
<c:when test="${reportNum != 'rpt513'} && ${reportNum !=
'rpt515'}">
<h1>This is some other report.</h1>
</c:when>
<c:otherwise>
<h1>This is either report 513 or 515.</h1>
</c:otherwise>
</c:choose>

The problem is that the complex condition in the "when" tag doesn't
work (the JSP always goes to the "otherwise" tag). Does anybody know
how to code this complex condition?

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Troy Kelley     Answered On: Apr 22

I think by chaning like this you can solve it:
<c:when test="${reportNum} != 'rpt513' && ${reportNum} !=
'rpt515'">

 
Didn't find what you were looking for? Find more on EL Complex Conditions Or get search suggestion and latest updates.




Tagged: