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?
请先登录再写评论。
of course, that code should look like this:
inside if ${param.hellothere != null} ]]>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
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!