tags:

views:

56

answers:

1

Hi, I've been googling around for quite some time now and I've decided to ask this here, how would I make the following code work?

        <c:if test="${null != searchResults}" >
            <c:forEach items="${searchResults}" var="result" varStatus="status">

I've tried many different variations of this, such as:

<c:if test="${searchWasPerformed}" >

or

<c:if test="<%=request.getAttribute("searchWasPerformed") %>" >

and even

<% boolean b = null != request.getAttribute("searchResults"); %>
    <c:if test="${b}" >

Which looks REALLY ugly :/ But I keep on getting the

org.apache.jasper.JasperException: /WEB-INF/jsp/admin/admin-index.jsp(29,2) PWC6236: According to TLD or attribute directive in tag file, attribute test does not accept any expressions

My question is, how would I go around this?

Thanks in advance! Erik

+2  A: 

Check version of JSTL taglib you use. It should be 1.1, so you should have (note the URI):

<%@ taglib prefix = "c" uri = "http://java.sun.com/jsp/jstl/core" %>
axtavt
Thank you both, the URI seems to have been an old one: http://java.sun.com/jstl/core
Erik
@Erik: That's the JSTL 1.0 URI. This doesn't go well with JSP 2.0 as you encountered.
BalusC