Try
<c:if test="${item.class.name == 'MySpecialClass')}">
that should work, or?
Bjoern
> -----Ursprüngliche Nachricht-----
> Von: Luca Passani [mailto:passani@eunet.no]
> Gesendet: Freitag, 17. März 2006 00:39
> An: Tag Libraries Users List
> Betreff: JSTL-EL question (instanceOf)
>
> Hi
>
> 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
> </c:if>
> :
>
> it should work on the same version of JSP supported by Tomcat
> 4 (1.2 if my memory doesn't fail me).
>
> Thanks
>
> Luca
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>
>
>
>
Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen. Wenn Sie
nicht der richtige Adressat sind oder diese E-Mail irrtuemlich erhalten haben, informieren
Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie
die unbefugte Weitergabe dieser Mail bzw. Inhalte hieraus ist nicht gestattet.
---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
|