Ralph Goers wrote:
Carsten Ziegeler wrote:

object that contains a Map would that also be accessed by
${cocoon.session.attributes.user.attributes.id}  ?

Ah, I see, no, it's simpler: if user is a map and "id" is a key in this map, you can simply use
${cocoon.session.attributes.user.id} this is automatically resolved for you.


The problem is, I didn't say "user is a map", I said "user is an object that contains a Map". If it inexplicably had a getId() method and the map contained an id key there would obviously be a problem.
so then you have user.id which maps to user.getId()
and user.mapName.id which maps to user.getMapName().get( 'id' );



The easiest way is to add a getAttributes() method to the session and the request object; these methods return a map and then everything works. The implementation is easy as the attributes are stored in a map anyway.


How many objects does this syntax drill down? Is it like JXPath in that regard?
Ralph




--
Leszek Gawron                                      [EMAIL PROTECTED]
Project Manager                                    MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65

Reply via email to