From: "David Schwartz" <[EMAIL PROTECTED]>

> 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
one
> that contains the ResultSet I want to output the query results.
>
> Is it possible using JSTL to determine if a request attribute is a
ResultSet?

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().
(Untested.)

<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}"/>

    </c:if>
</c:forEach>

-- 
Wendy Smoak


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to