Link to home
Start Free TrialLog in
Avatar of MJ
MJFlag for United States of America

asked on

JSTL test always evaluates to true????

I have tried this 2 different ways, this works properly:

   <c:set var="pageId"><%=pageID%></c:set>
    <c:if test="${pg.pageID.value eq pageId}">

But the following doesn't, it always evaluates to true:

 <%@ taglib uri="http://java.sun.com/jstl/core-rt" prefix="c-rt" %>
    <c-rt:if test="${pg.pageID.value eq '<%=pageID%>'}">

I out put the values after the statement and they are different? Any idea why???


Avatar of boonleng
boonleng
Flag of Malaysia image

In my last post http:Q_21532610.html#14706926 I mention that it can't mix EL and RT script together.
To allow RT script to access EL variable, <jsp:useBean> will be used to map the EL variable as bean.

ps: The taglib uri should be http://java.sun.com/jstl/core_rt instead of http://java.sun.com/jstl/core-rt. Sorry for given the incorrect path on my last post.
Avatar of MJ

ASKER

NO biggie I didn't have to use it on my server. So what do you mean you can't mix them? I didn't, I tried the first but that didn't work so I tried the second which worked. Are you saying that if you use RT all jstl  has to be RT????
ASKER CERTIFIED SOLUTION
Avatar of boonleng
boonleng
Flag of Malaysia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MJ

ASKER

I gotcha!!!!! THANKS AGAIN!