You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Geoffrey Arnold <ge...@geoffreyarnold.com> on 2004/05/05 21:52:44 UTC
[Jelly] Tag attributes corresponding to arrays
Hi All.
I have been testing Jelly and JellySwing extensively and am encouraged
by their potential as an Java alternative to Windows Forms .NET.
I recently came across a problem with tag attributes which correspond to
arrays in JavaBeans. For example, given the following bean:
public class SampleBean {
public String[] theArray;
...
public String[] getTheArray() {
return this.theArray;
}
public void setTheArray(String[] anArray) {
this.theArray = anArray;
}
}
... I hoped to be able to set the value of "theArray" using XML similar
to the following:
<jelly:useBean var="sampleBean" class="SampleBean" theArray="element1,
element2, element3"/>
However, instead of converting the attribute value to an array of three
elements (ie. new String[3] {"element1", "element2", "element3"}) as
intended, the result was an array with one element consisting of the
entire attribute value (ie. new String[1] {"element1, element2,
element3"}). After some investigation I was able to determine that this
behavior is caused by the use of the methods BeanUtils.setProperty() and
BeanUtils.populate() which are "...customized for extracting
String-based request parameters from an HTTP request"
(http://jakarta.apache.org/commons/beanutils/api/org/apache/commons/beanutils/BeanUtils.html#populate(java.lang.Object,%20java.util.Map)).
I was able to produce the desired behavior by changing all references to
these methods to the alternative functions BeanUtils.copyProperty() and
BeanUtils.copyProperties(), respectively, which properly convert the
attribute values.
Attached is a diff for the offending classes contained in the Jelly and
JellySwing tag libraries. Also note that a quick search revealed
classes in other Jelly tag libraries which will require changes:
jelly-tags/ant/src/java/org/apache/commons/jelly/tags/ant/AntTag.java
jelly-tags/ant/src/java/org/apache/commons/jelly/tags/ant/FileScannerTag.java
jelly-tags/bean/src/java/org/apache/commons/jelly/tags/bean/BeanTag.java
jelly-tags/dynabean/src/java/org/apache/commons/jelly/tags/dynabean/SetTag.java
jelly-tags/swt/src/java/org/apache/commons/jelly/tags/swt/LayoutTagSupport.java
Hope this helps.
Geoff.
Re: [Jelly] Tag attributes corresponding to arrays
Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
On 10 May 2004, at 22:28, Geoffrey Arnold wrote:
> Any more comments on this? Is Jelly being actively developed?
it's not the most actively developed component in commons but there are
currently a lot of important issues that have emerged concerning the
collections component (and all those libraries, frameworks and
containers that depend on that component). these are taking a lot of
time for a lot of commons folks at the moment.
in addition, i'm a jelly newbie and i'm very reluctant to make any core
changes without paul's advice. with a bit of luck, he might jump in
sometime soonish :)
- robert
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [Jelly] Tag attributes corresponding to arrays
Posted by Geoffrey Arnold <ge...@geoffreyarnold.com>.
Geoffrey Arnold wrote:
> I am putting together a patch containing all of the necessary changes
> to Jelly and its tag libraries, including the compatibility Converter
> implementation I mentioned in a previous email. I will post it to the
> list ASAP.
Attached is a diff (@see commons-jelly.diff) containing changes to Jelly
classes and Jelly tag library classes in order to enable proper
String->Array conversions for XML attributes. Also attached is a sample
Converter class (@see StrutsStyleStringArrayConverter.java) which can be
used to simulate the current conversion behavior for backwards
compatibility with existing code. To enable the compatibility
converter, invoke the following line of code *before* running your Jelly
script:
org.apache.commons.beanutils.ConvertUtils.register(
new StrutsStyleStringArrayConverter(),String[].class
);
Please note that the diff also updates the version of the
commons-beanutils library in jelly-tags/tag-project.xml to release 1.6.1
in order to fix a bug
(http://issues.apache.org/bugzilla/show_bug.cgi?id=16525) in the
BeanUtils.copyProperty(Object,String,Object) method.
Hope this helps.
Geoff.
Re: [Jelly] Tag attributes corresponding to arrays
Posted by Geoffrey Arnold <ge...@geoffreyarnold.com>.
dion_gillard@multitask.com.au wrote:
>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.
>
>
Just a quick follow-up:
I have discovered a problem with building the DynaBean Jelly tag library
after applying the appropriate changes to
org.apache.commons.jelly.tags.dynabean.SetTag, causing the
"nestedDynaBean" test case to fail. After some investigation I was able
to determine that the error is caused by a bug
(http://issues.apache.org/bugzilla/show_bug.cgi?id=16525) in
commons-beanutils version 1.6 (library dependency specified in
jelly-tags/tag-project.xml) which was subsequently fixed in release 1.6.1.
I am putting together a patch containing all of the necessary changes to
Jelly and its tag libraries, including the compatibility Converter
implementation I mentioned in a previous email. I will post it to the
list ASAP.
Geoff.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [Jelly] Tag attributes corresponding to arrays
Posted by Geoffrey Arnold <ge...@geoffreyarnold.com>.
robert burrell donkin wrote:
> 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.
Doesn't this assume that the current behavior is "correct"?
IMHO the current behavior is a bug. Given an object with a setter
method that accepts a String[] argument, I would expect that I could
register a Converter for the String[] type to control how the XML
attribute is parsed into an array (the entire preface for
ConvertUtils). However, the use of the BeanUtils.populate() and
BeanUtils.setProperty() methods circumvents this ability. Furthermore,
the BeanUtils documentation plainly states that populate() and
setProperty() do not perform type conversions properly and are really
only useful in the context of Struts.
Therefore I do not believe that maintaining backwards compatibility
should be considered a priority as the current implementation is
broken. And although I do not have any data to back this up, I believe
that it would be a _very_ rare case for users to parse the
single-element array in their setter functions to perform the proper
conversion.
Geoff.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [Jelly] Tag attributes corresponding to arrays
Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
On 11 May 2004, at 16:47, dion_gillard@multitask.com.au wrote:
> Geoffrey Arnold <ge...@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
Re: [Jelly] Tag attributes corresponding to arrays
Posted by di...@multitask.com.au.
Geoffrey Arnold <ge...@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.
--
dIon Gillard, Multitask Consulting
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [Jelly] Tag attributes corresponding to arrays
Posted by Geoffrey Arnold <ge...@geoffreyarnold.com>.
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.
Geoff.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [Jelly] Tag attributes corresponding to arrays
Posted by di...@multitask.com.au.
I'm a bit wary of suddenly Jelly converting strings with commas in them
into arrays....
--
dIon Gillard, Multitask Consulting
Paul Libbrecht <pa...@activemath.org> wrote on 11/05/2004 05:13:58 PM:
>
> On 11-May-04, at 00:52 Uhr, Geoffrey Arnold wrote:
> >> What if you suggested a patch following the suggestion of Robert ?
> >> I think this is exactly what we would be looking for.
> > I actually submitted a patch with my original post. I think what
> > Robert was looking for was some sort of validation of the suggested
> > fix from you and/or other Jelly developers.
>
> No, I think the patch you submitted was one to have the "," and others
> kind of always treated. We need core-tags, as Robert said, that are
> going to influence the behaviour of this conversion.
>
> paul
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [Jelly] Tag attributes corresponding to arrays
Posted by Paul Libbrecht <pa...@activemath.org>.
On 11-May-04, at 00:52 Uhr, Geoffrey Arnold wrote:
>> What if you suggested a patch following the suggestion of Robert ?
>> I think this is exactly what we would be looking for.
> I actually submitted a patch with my original post. I think what
> Robert was looking for was some sort of validation of the suggested
> fix from you and/or other Jelly developers.
No, I think the patch you submitted was one to have the "," and others
kind of always treated. We need core-tags, as Robert said, that are
going to influence the behaviour of this conversion.
paul
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [Jelly] Tag attributes corresponding to arrays
Posted by Geoffrey Arnold <ge...@geoffreyarnold.com>.
Hi Paul.
> What if you suggested a patch following the suggestion of Robert ?
> I think this is exactly what we would be looking for.
I actually submitted a patch with my original post. I think what Robert
was looking for was some sort of validation of the suggested fix from
you and/or other Jelly developers.
Regards.
Geoff.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [Jelly] Tag attributes corresponding to arrays
Posted by Geoffrey Arnold <ge...@geoffreyarnold.com>.
Any more comments on this? Is Jelly being actively developed?
robert burrell donkin wrote:
> On 6 May 2004, at 18:35, Geoffrey Arnold wrote:
>
>> Hi Robert.
>>
>>> i think that you might be able to achieve the same result by
>>> registering a custom convertor. this is currently a little icky to
>>> do but it would probably be possible to add some (probably core)
>>> tags that would allow the conversions to be customized. i'm not
>>> sure whether that'd be a good idea or not.
>>
>>
>> Unfortunately, I think that this behavior is hardcoded in
>> BeanUtils.setProperty() method at lines 979-981 (of release 1.6.1).
>> Basically the code stuffs the value into a single element array
>> _before_ calling the CovertUtils.convert() method.
>
>
> fair 'nuff
>
>>> in some ways, using the specialized http copy makes some sense
>>> because jelly's stringy like html but the implementation is less
>>> sophisticated. would altering one to the other cause loads of stuff
>>> to break?
>>
>>
>> I don't follow the first comment.
>
>
> i meant http copying involves strings-to-beans (rather than general
> bean-to-bean) so it sort of makes sense from that perspective. not
> sure what other effects moving from one to the other would have.
>
> maybe it'd be possible to add a namespaced attribute
> (?jelly:conversion='classic'?) which could be inherited and so allow
> the user to control the tag <-> bean mapping.
>
>> As for breaking existing code, I was afraid of this also, but after
>> skimming through the code (and running the unit tests :) ), it
>> appears that the changes do not adversely affect any of the Jelly
>> codebase. I believe that these changes would only affect existing
>> users who have modified their "setTheArray(String[])" methods to
>> parse the first element of the array to convert it to the proper
>> array (which would be counter-intuitive).
>
>
> can anyone else think of anything that this change is likely to break?
>
> - robert
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
>
> .
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [Jelly] Tag attributes corresponding to arrays
Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
On 6 May 2004, at 18:35, Geoffrey Arnold wrote:
> Hi Robert.
>
>> i think that you might be able to achieve the same result by
>> registering a custom convertor. this is currently a little icky to do
>> but it would probably be possible to add some (probably core) tags
>> that would allow the conversions to be customized. i'm not sure
>> whether that'd be a good idea or not.
>
> Unfortunately, I think that this behavior is hardcoded in
> BeanUtils.setProperty() method at lines 979-981 (of release 1.6.1).
> Basically the code stuffs the value into a single element array
> _before_ calling the CovertUtils.convert() method.
fair 'nuff
>> in some ways, using the specialized http copy makes some sense
>> because jelly's stringy like html but the implementation is less
>> sophisticated. would altering one to the other cause loads of stuff
>> to break?
>
> I don't follow the first comment.
i meant http copying involves strings-to-beans (rather than general
bean-to-bean) so it sort of makes sense from that perspective. not sure
what other effects moving from one to the other would have.
maybe it'd be possible to add a namespaced attribute
(?jelly:conversion='classic'?) which could be inherited and so allow
the user to control the tag <-> bean mapping.
> As for breaking existing code, I was afraid of this also, but after
> skimming through the code (and running the unit tests :) ), it appears
> that the changes do not adversely affect any of the Jelly codebase. I
> believe that these changes would only affect existing users who have
> modified their "setTheArray(String[])" methods to parse the first
> element of the array to convert it to the proper array (which would be
> counter-intuitive).
can anyone else think of anything that this change is likely to break?
- robert
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [Jelly] Tag attributes corresponding to arrays
Posted by Geoffrey Arnold <ge...@geoffreyarnold.com>.
Hi Robert.
> i think that you might be able to achieve the same result by
> registering a custom convertor. this is currently a little icky to do
> but it would probably be possible to add some (probably core) tags
> that would allow the conversions to be customized. i'm not sure
> whether that'd be a good idea or not.
Unfortunately, I think that this behavior is hardcoded in
BeanUtils.setProperty() method at lines 979-981 (of release 1.6.1).
Basically the code stuffs the value into a single element array _before_
calling the CovertUtils.convert() method.
> in some ways, using the specialized http copy makes some sense
> because jelly's stringy like html but the implementation is less
> sophisticated. would altering one to the other cause loads of stuff
> to break?
I don't follow the first comment.
As for breaking existing code, I was afraid of this also, but after
skimming through the code (and running the unit tests :) ), it appears
that the changes do not adversely affect any of the Jelly codebase. I
believe that these changes would only affect existing users who have
modified their "setTheArray(String[])" methods to parse the first
element of the array to convert it to the proper array (which would be
counter-intuitive).
Geoff.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [Jelly] Tag attributes corresponding to arrays
Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
hmmm...
here's some (disconnected) comments:
the use of beanutils in jelly is one of the big issues that needs to be
resolved (or at least thought about). we're going to have to release a
new version of beanutils very soon (to solve collections 2.0/3.0
compatibility issues) and it's possible that the new beanified stuff
might be useful in jelly.
i think that you might be able to achieve the same result by
registering a custom convertor. this is currently a little icky to do
but it would probably be possible to add some (probably core) tags that
would allow the conversions to be customized. i'm not sure whether
that'd be a good idea or not.
in some ways, using the specialized http copy makes some sense because
jelly's stringy like html but the implementation is less sophisticated.
would altering one to the other cause loads of stuff to break?
comments welcome but probably paul or dIon are the people who need to
jump in...
- robert
On 5 May 2004, at 20:52, Geoffrey Arnold wrote:
> Hi All.
>
> I have been testing Jelly and JellySwing extensively and am encouraged
> by their potential as an Java alternative to Windows Forms .NET.
>
> I recently came across a problem with tag attributes which correspond
> to arrays in JavaBeans. For example, given the following bean:
>
> public class SampleBean {
> public String[] theArray;
> ...
> public String[] getTheArray() {
> return this.theArray;
> }
> public void setTheArray(String[] anArray) {
> this.theArray = anArray;
> }
> }
>
> ... I hoped to be able to set the value of "theArray" using XML
> similar to the following:
>
> <jelly:useBean var="sampleBean" class="SampleBean" theArray="element1,
> element2, element3"/>
>
> However, instead of converting the attribute value to an array of
> three elements (ie. new String[3] {"element1", "element2",
> "element3"}) as intended, the result was an array with one element
> consisting of the entire attribute value (ie. new String[1]
> {"element1, element2, element3"}). After some investigation I was
> able to determine that this behavior is caused by the use of the
> methods BeanUtils.setProperty() and BeanUtils.populate() which are
> "...customized for extracting String-based request parameters from an
> HTTP request"
> (http://jakarta.apache.org/commons/beanutils/api/org/apache/commons/
> beanutils/BeanUtils.html#populate(java.lang.Object,%20java.util.Map)).
> I was able to produce the desired behavior by changing all references
> to these methods to the alternative functions BeanUtils.copyProperty()
> and BeanUtils.copyProperties(), respectively, which properly convert
> the attribute values.
>
> Attached is a diff for the offending classes contained in the Jelly
> and JellySwing tag libraries. Also note that a quick search revealed
> classes in other Jelly tag libraries which will require changes:
>
> jelly-tags/ant/src/java/org/apache/commons/jelly/tags/ant/AntTag.java
>
> jelly-tags/ant/src/java/org/apache/commons/jelly/tags/ant/
> FileScannerTag.java
>
> jelly-tags/bean/src/java/org/apache/commons/jelly/tags/bean/
> BeanTag.java
>
> jelly-tags/dynabean/src/java/org/apache/commons/jelly/tags/dynabean/
> SetTag.java
>
> jelly-tags/swt/src/java/org/apache/commons/jelly/tags/swt/
> LayoutTagSupport.java
>
> Hope this helps.
> Geoff.
> Index:
> jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/
> ComponentTag.java
> ===================================================================
> RCS file:
> /home/cvspublic/jakarta-commons/jelly/jelly-tags/swing/src/java/org/
> apache/commons/jelly/tags/swing/ComponentTag.java,v
> retrieving revision 1.17
> diff -u -r1.17 ComponentTag.java
> ---
> jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/
> ComponentTag.java 25 Feb 2004 01:31:56 -0000 1.17
> +++
> jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/
> ComponentTag.java 5 May 2004 18:04:14 -0000
> @@ -59,7 +59,7 @@
>
> /** the factory of widgets */
> private Factory factory;
> -
> +
> public ComponentTag() {
> }
>
> @@ -82,7 +82,7 @@
> if ( component != null ) {
> // lets just try set the 'action' property
> try {
> - BeanUtils.setProperty( component, "action", action );
> + BeanUtils.copyProperty( component, "action", action );
> } catch (IllegalAccessException e) {
> throw new JellyTagException(e);
> } catch (InvocationTargetException e) {
> @@ -99,7 +99,7 @@
> if ( component != null ) {
> // lets just try set the 'font' property
> try {
> - BeanUtils.setProperty( component, "font", font );
> + BeanUtils.copyProperty( component, "font", font );
> }
> catch (IllegalAccessException e) {
> throw new JellyTagException(e);
> @@ -118,7 +118,7 @@
> if ( component != null ) {
> try {
> // lets just try set the 'border' property
> - BeanUtils.setProperty( component, "border", border );
> + BeanUtils.copyProperty( component, "border", border );
> }
> catch (IllegalAccessException e) {
> throw new JellyTagException(e);
> @@ -142,7 +142,7 @@
>
> try {
> // lets just try set the 'layout' property
> - BeanUtils.setProperty( component, "layout", layout );
> + BeanUtils.copyProperty( component, "layout", layout );
> }
> catch (IllegalAccessException e) {
> throw new JellyTagException(e);
> @@ -383,7 +383,7 @@
> }
> else {
> try {
> - BeanUtils.setProperty(component, name, value);
> + BeanUtils.copyProperty(component, name,
> value);
> } catch (IllegalAccessException e) {
> throw new JellyTagException(e);
> } catch (InvocationTargetException e) {
> @@ -393,7 +393,7 @@
> }
> else {
> try {
> - BeanUtils.setProperty(bean, name, value);
> + BeanUtils.copyProperty(bean, name, value);
> } catch (IllegalAccessException e) {
> throw new JellyTagException(e);
> } catch (InvocationTargetException e) {
> Index:
> jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/
> ConstraintTag.java
> ===================================================================
> RCS file:
> /home/cvspublic/jakarta-commons/jelly/jelly-tags/swing/src/java/org/
> apache/commons/jelly/tags/swing/ConstraintTag.java,v
> retrieving revision 1.9
> diff -u -r1.9 ConstraintTag.java
> ---
> jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/
> ConstraintTag.java 1 Mar 2004 12:35:18 -0000 1.9
> +++
> jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/
> ConstraintTag.java 5 May 2004 18:04:14 -0000
> @@ -98,7 +98,7 @@
> } else {
>
> try {
> - BeanUtils.setProperty( bean, name, value );
> + BeanUtils.copyProperty( bean, name, value );
> } catch (IllegalAccessException e) {
> throw new JellyTagException(e.toString());
> } catch (InvocationTargetException e) {
> Index:
> src/java/org/apache/commons/jelly/tags/core/SetPropertiesTag.java
> ===================================================================
> RCS file:
> /home/cvspublic/jakarta-commons/jelly/src/java/org/apache/commons/
> jelly/tags/core/SetPropertiesTag.java,v
> retrieving revision 1.7
> diff -u -r1.7 SetPropertiesTag.java
> ---
> src/java/org/apache/commons/jelly/tags/core/SetPropertiesTag.java 24
> Feb 2004 14:10:38 -0000 1.7
> +++
> src/java/org/apache/commons/jelly/tags/core/SetPropertiesTag.java 5
> May 2004 18:04:15 -0000
> @@ -80,7 +80,7 @@
> */
> protected void setBeanProperties(Object bean, Map attributes)
> throws JellyTagException {
> try {
> - BeanUtils.populate(bean, attributes);
> + BeanUtils.copyProperties(bean, attributes);
> } catch (IllegalAccessException e) {
> throw new JellyTagException("could not set the properties
> on a bean",e);
> } catch (InvocationTargetException e) {
> Index: src/java/org/apache/commons/jelly/tags/core/SetTag.java
> ===================================================================
> RCS file:
> /home/cvspublic/jakarta-commons/jelly/src/java/org/apache/commons/
> jelly/tags/core/SetTag.java,v
> retrieving revision 1.17
> diff -u -r1.17 SetTag.java
> --- src/java/org/apache/commons/jelly/tags/core/SetTag.java 24 Feb
> 2004 14:10:38 -0000 1.17
> +++ src/java/org/apache/commons/jelly/tags/core/SetTag.java 5 May 2004
> 18:04:15 -0000
> @@ -172,7 +172,7 @@
> map.put( property, value );
> }
> else {
> - BeanUtils.setProperty( target, property, value );
> + BeanUtils.copyProperty( target, property, value );
> }
> } catch (InvocationTargetException e) {
> log.error( "Failed to set the property: " + property + "
> on bean: " + target + " to value: " + value + " due to exception: " +
> e, e );
> Index: src/java/org/apache/commons/jelly/tags/core/UseBeanTag.java
> ===================================================================
> RCS file:
> /home/cvspublic/jakarta-commons/jelly/src/java/org/apache/commons/
> jelly/tags/core/UseBeanTag.java,v
> retrieving revision 1.14
> diff -u -r1.14 UseBeanTag.java
> --- src/java/org/apache/commons/jelly/tags/core/UseBeanTag.java 24 Feb
> 2004 14:10:38 -0000 1.14
> +++ src/java/org/apache/commons/jelly/tags/core/UseBeanTag.java 5 May
> 2004 18:04:15 -0000
> @@ -166,7 +166,7 @@
> */
> protected void setBeanProperties(Object bean, Map attributes)
> throws JellyTagException {
> try {
> - BeanUtils.populate(bean, attributes);
> + BeanUtils.copyProperties(bean, attributes);
> } catch (IllegalAccessException e) {
> throw new JellyTagException("could not set the properties
> of the bean",e);
> } catch (InvocationTargetException e) {
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org