At 10:45 AM -0700 4/24/04, Michael McGrady wrote:
In my opinion, one should have a tag that allows us to work with nested maps, such that we can retrieve maps as follows:

<jsp:useBean id="foo" class="com.do.wacka.do.TestBeanMap"/><BR>
String: <bean:write name="foo" property="property(keyAlpha).property(keyOmega)"/>
where getProperty("keyAlpha") in foo returns a map with a key "keyOmega" holding a String or other writable class.

If the return of "foo.getProperty("keyAlpha")" returns a map, then no, this won't work. The BeanUtils library is responsible for handling this, and it does not seamlessly treat map keys as properties. (http://jakarta.apache.org/commons/beanutils/)


While I haven't ever used it, I believe that this is an area where the CGLIB libraries have leapfrogged Commons BeanUtils. see http://cglib.sourceforge.net/, http://sixlegs.com/blog/java/death-to-dynabeans.html, and possibly http://sixlegs.com/blog/java/bean-map-hybrids.html


I have been trying to find out, unsuccessfully if we have that. It seems we don't but only have maps which can be used when automatically initialized in a set way via reflection. If we don't have this, please let me know. I will build it.

It would probably be no small project to change Struts to depend on CGLIB instead of DynaBeans (and it may not even be a good idea) but if you find that CGLIB does things that are useful that BeanUtils can't, it would be worth bringing up on the [EMAIL PROTECTED] or [EMAIL PROTECTED] mailing lists.


Whether or not the solution is to replace BeanUtils with CGLIB or to improve BeanUtils, your interest and energy would be appreciated by the Struts user and developer communities.

Joe

--
Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "Imagine if every Thursday your shoes exploded if you tied them the usual way. This happens to us all the time with computers, and nobody thinks of complaining."
-- Jef Raskin


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



Reply via email to