commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robert burrell donkin <robertburrelldon...@blueyonder.co.uk>
Subject Re: [Jelly] Tag attributes corresponding to arrays
Date Tue, 11 May 2004 19:48:59 GMT
On 11 May 2004, at 16:47, dion_gillard@multitask.com.au wrote:
> Geoffrey Arnold <geoffrey@geoffreyarnold.com> wrote on 12/05/2004 
> 12:58:29
> AM:
>> dion_gillard@multitask.com.au 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' >
	<some:tag>
		...
	</some:tag>
</jelly:control>

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'>
	...
</jelly:control>

anywy, just my tuppence...

- robert


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message