Hello there, I'm quite new with jstl and I've alredy made a search.
A jsp page expects to receive a parameter or an attribute (called "id"), it uses that to retrieve an object from an ArrayList which should find a match with a same attribute name.
At the moment I understood how do that passing the parameter <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> <%@taglib uri="http://jakarta.apache.org/taglibs/request-1.0" prefix="req" %> <c:forEach var="item" items="${sessionScope.newsList}"> <c:if test="${item.id == param.id}">
But I'm stuck tring to modify that condition in something like <c:if test="${item.id == param.id || item.id == requestScope.id}"> which doesn't work for some reasons that I don't know.
I'd apreciate any help from you. Thanks in advance.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35241
7
posted
0
The EL in JSTL uses the "eq" operator to test for equality, not "==", and it uses "or", not "||". I'm not enough of an expert on EL to say whether those have identical meaning, but that's where I'd start to investigate. [ February 04, 2007: Message edited by: Ulf Dittmer ]
Originally posted by Alessandro Ilardo: which doesn't work for some reasons that I don't know.
"it doesn't work" is the single most useless phrase that appears quite often here.
How does it not work? How did you verify that it's not working? How did you prove that the conditions set up prior to the expression contain what you think they contain?