JSP EL help

Anybody here familiar with JSP EL, especially when using <c:if> tags from the JSTL? I'm trying to test if a parameter exists, but the expression is always evaluating to true within the c:if tag, even tho it's false.

For instance:

inside if
${param.hellothere != null]]>

}

outputs:


I'm using Tomcat 5. Anybody here know why the c:if tag would evaluate it as true, when the expression clearly returns false?

0
3 comments
Avatar
Permanently deleted user

of course, that code should look like this:

inside if
${param.hellothere != null}
]]>

0

not sure, that is some funky behavior. You may want to try something like:
<c:if test='${not empty param.helloThere}'>...</c:if>

http://www.informit.com/articles/printerfriendly.asp?p=30946

0
Avatar
Permanently deleted user

I just figured it out. I was importing my tag library definitions with a <jsp:include> tag instead of a <%@ include %> static include, so my taglibs weren't actually active.

Thanks for that great link btw!

0

Please sign in to leave a comment.