tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luca Passani <>
Subject JSTL-EL question (instanceOf)
Date Thu, 16 Mar 2006 23:39:18 GMT

here is my problem today. I am dealing with an API that I have not 
written and that is not very object oriented.

I have a list of objects that have no common super class (or better, 
they have Object).
In my JSP, which I would love to keep scriptlets-free, I need to loop 
through the list and treat each object differently depending on the 
type. Is there a way to do instanceOf using EL?

<c:forEach var="item"  items="${content_list}">
 <c:if test="${item.instanceOf(MySpecialClass)}">
    render my special class

it should work on the same version of JSP supported by Tomcat 4 (1.2 if 
my memory doesn't fail me).



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

View raw message