tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karr, David" <>
Subject RE: Designing Good Objects for EL
Date Tue, 03 Sep 2002 18:50:36 GMT
> -----Original Message-----
> From: Mark R. Diggory []
> Sent: Tuesday, September 03, 2002 11:41 AM
> To: Tag Libraries Users List
> Subject: Designing Good Objects for EL
> Ugh,
> I've been plagued with issues that have to do with EL and accessing 
> Attributes/Properties in Objects. It turns out that the 
> following is a 
> very big issue:
> 1.) Objects that extend or implment java.util.Collection api 
> will always 
> revert to that api when you try to access them using EL.
> for example:
>     if an object extends HashMap and has both the method 
> 'get(Object o)' 
> and the method 'getFooBar()' EL will try to use the 'get("fooBar")' 
> method for 'object.fooBar' and not call getFooBar() so Collection 
> objects can only be Collection objects and JavaBeans can only be 
> JavaBeans. They cannot be mixed.
> 2.) JavaBeans specs limit what an Object can contain in terms of 
> methods. I always disliked that they haven't made JavaBeans any 
> "smarter" than "get/set" I'm always wanting to do things like 
> "add/remove". Really!, whats the use of the Collections API if I'm 
> always stuck converting Collections to Object[]'s just to 
> spit them in 
> and out through the JavaBean Api.
> This is tough in JSTL
>     if I want to call a non-bean method I have to get my own 
> reference 
> to the object and use that <% 
> ((ObjectCast)pageContext.getAttribute("fooBar")).method(); %>
> Finally,
> Does EL have capabilities for "Indexed" JavaBean patterns? I 
> can't find 
> any online documentation on this?

You'll just have to wait like the rest of us :) .

Others can provide more detailed information here, but basically it's not
there yet.  I think it's clear that we'll eventually get access to
Collection API methods, or more general access to object methods, through
the EL, but not yet.  As we provide/get more useful features in systems, we
always see "the next logical step", which is what happened here.

It would be worthwhile, for us as individuals, to investigate what is
provided in the EL and consider experimenting with how we could extend the
API, or integrate with it, to provide features like this, so we can better
understand it when it comes, or even participate in the development itself.

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

View raw message