tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Schwartz ...@arrayone.com>
Subject Re: Dynamic Evaluation
Date Thu, 28 Apr 2005 21:54:54 GMT
Thanks everyone for your help.
Using the requestScope[] as Rahul suggested worked.
The [] handles the dynamic evaluation of vars.

>>If _you_ called request.setAttribute(...) then surely you know what name you
saved the ResultSet(s) under.

That is also dynamic & based on user input, at run time.

Quoting Wendy Smoak <java@wendysmoak.com>:

>> From: "David Schwartz" <ds@arrayone.com>
>>
>> > 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: taglibs-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>>
>>


David Schwartz

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Mime
View raw message