Craig R. McClanahan wrote:
> 
> On Thu, 4 Apr 2002, Torgeir Veimo wrote:
> 
> 
>>Date: Thu, 04 Apr 2002 14:15:09 +0200
>>From: Torgeir Veimo <[EMAIL PROTECTED]>
>>Reply-To: Struts Developers List <[EMAIL PROTECTED]>
>>To: Struts Developers List <[EMAIL PROTECTED]>
>>Subject: mapped properties and jndi's Attributes
>>
>>I would like to use mappend properties with jndi, but using
>>
>><bean:write name='entry' property='(cn)' />
>>
>>doesn't work, since PropertyUtils chokes when not supplying anything
>>before the opening parenthesis. Ideally a property of (string) would map
>>to get(string), which is the getter method on Attributes.
>>
>>I thought I could look into PeopertyUtils to support this, but the code
>>is a bit hard to get into at first sight.
>>
>>Has anyone thought of supporting get(String id) style properties in struts?
>>
> 
> 
> If you use DynaBean based beans, you can get pretty much the same effect
> by just using:
> 
>   <bean:write name='entry' property='cn'/>
> 
> because the underlying DynaBean property ends up being retrieved with:
> 
>   String cn = entry.get("cn");
> 
> (This works in the nightly builds and in Struts 1.1-b1 -- it uses the most
> recent commons-beanutils nightly builds as well.)

Well, but dynabeans must be declared in the struts-config file in 
advance, to my knowledge, so they aren't as dynamic as my ldap entries 
are. The above example works for java classes where

<bean:write name='entry' property='property(cn)'/>

translates to getProperty("cn"), just not for get("cn"). I thought this 
would be a very minor fix (tweak) to PropertyUtils, not an extension of 
the expression language.






-- 
-Torgeir


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

Reply via email to