tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wendy Smoak <>
Subject Re: Dynamic Evaluation
Date Thu, 28 Apr 2005 21:46:40 GMT
From: "David Schwartz" <>

> A request attribute is set from a servlet via request.setAttribute.
> The attribute is a ResultSet.
> On the JSP page I want to loop through all request attributes. When I find
> that contains the ResultSet I want to output the query results.
> Is it possible using JSTL to determine if a request attribute is a

I don't see why you would need to--  If _you_ called
request.setAttribute(...) then surely you know what name you saved the
ResultSet(s) under.  I think I would set another request attribute with a
List of those names, and iterate over that, not the entire set of request
attributes.   But if you must...

This is a hack since it depends on the output of Class.toString().

<c:forEach var="item" items="${requestScope}">
    <c:if test="${item.value.class eq 'class some.package.ResultSet'}">
         The key it was saved under: <c:out value="${item.key}"/>
         The ResultSet itself: <c:out value="${item.value}"/>


Wendy Smoak

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message