commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robert burrell donkin <>
Subject Re: [Jelly] Tag attributes corresponding to arrays
Date Tue, 11 May 2004 19:48:59 GMT
On 11 May 2004, at 16:47, wrote:
> Geoffrey Arnold <> wrote on 12/05/2004 
> 12:58:29
> AM:
>> wrote:
>>> I'm a bit wary of suddenly Jelly converting strings with commas in 
>>> them
>>> into arrays....
>> To be clear, the conversion _only_ happens when the setter method of 
>> the
>> target object accepts an array argument.  And how the conversion is
>> performed can be controlled by (un)registering an appropriate
>> org.apache.commons.beanutils.Converter.  Perhaps a compromise would be
>> to register a compatibility converter in Jelly which by default mimics
>> the current conversion behavior.
>> The main point is that in its current form, one _cannot_ control this
>> conversion in Jelly as the behavior is hard-coded in the
>> BeanUtils.setProperty(Object,String,Object) method.
> Based on the above, it sounds like a harmless addition. Can someone 
> think
> of a case where it would be unwanted?
> If someone has a setter argument of type String[] and is expected a one
> element array from a string attribute and gets multiple, that'd be 
> pretty
> rare.

true :)

the bigger concern was switching all the conversions from one beanutils 
system of conversions to another. there's a possibility of nasty side 
effects which (since jelly's not particularly well tested) may well bit 
people. it's hard to say how likely this would be in practice, though.

i suppose that we could think about introducing control tags which 
would allow the mapping to be influenced. maybe something like

<jelly:control mapping='whatever' >

then the tags inside the control tag would be mapped using whatever 
'whatever' actually is.

could introduce custom mapping classes later, if that's ever needed.

<jelly:control mapping='com.example.whatever.WhatEver'>

anywy, just my tuppence...

- robert

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

View raw message