Re: BeanUtils.copyProperties()

2004-01-08 Thread Mark Lowe
You could just set that property by hand after most of you properties are copied BeanUtils.copyProperties( fooBean, barBean); fooBean.setDate(barBean.getDate()); beanutils would still be doing most the work for you. On 7 Jan 2004, at 23:32, Larry Meadors wrote: Yeah, beanutils is a pain that

Re: BeanUtils.copyProperties()

2004-01-07 Thread Larry Meadors
Yeah, beanutils is a pain that way. It does the same (and worse IMO) with other data types (i.e., set "fred" into an Integer, and it becomes 0, not null, and no exception is thrown). You might want to try PropertyUtils.copyProperties() instead. It *might* work. Larry >>> [EMAIL PROTECTED] 0

BeanUtils.copyProperties()

2004-01-07 Thread Dixon Tim Contr HQ SSG/STN
I'm doing a copyProperties to an Entity from a DTO. Why is it that if a date field is null, a date is returned as if I had passed a value of 0 to the copy method for the date. I.E. I passed a null date into copyProperties, but I got back a non-null date. What gives? Thx, /tim -

Re: Problem with BeanUtils.copyProperties()

2004-01-04 Thread Patrick Scheuerer
Hi Ivan, I had a mistake in my value object. Be sure to check the following things: For every form field in your form there must be one and only one setter method with the same name. So if you have a form field called firstName there has to be a method setFirstName() in your Bean. The second t

RE: Problem with BeanUtils.copyProperties()

2004-01-04 Thread Ivan De La Pena
: Re: Problem with BeanUtils.copyProperties() and in contrary to my earlier problem, there's no other method with the same method name... Patrick Scheuerer wrote: > Argh! I'm about to loose my sanity over this... > > The problem with the String[] is now working but there'

Re: Problem with BeanUtils.copyProperties()

2004-01-02 Thread Craig R. McClanahan
Quoting Patrick Scheuerer <[EMAIL PROTECTED]>: > If there are multiple methods with the same name, shouldn't copyProperties() > pick the one with the same method signature as in the source bean??? In my > opinion this would at least be a desirable default behavior No, it shouldn't. BeanUtil

Re: Problem with BeanUtils.copyProperties()

2004-01-02 Thread Patrick Scheuerer
and in contrary to my earlier problem, there's no other method with the same method name... Patrick Scheuerer wrote: Argh! I'm about to loose my sanity over this... The problem with the String[] is now working but there's a new one of course :-( For some reason BeanUtils

Re: Problem with BeanUtils.copyProperties()

2004-01-02 Thread Patrick Scheuerer
Argh! I'm about to loose my sanity over this... The problem with the String[] is now working but there's a new one of course :-( For some reason BeanUtils.copyProperties() doesn't call a setter method in the destination bean. Here's the definition of the form field

Re: Problem with BeanUtils.copyProperties()

2004-01-02 Thread Nicolas De Loof
I think the javabean spec doesn't allow multiple setters for a single property. If I'm right, you cannot have two setXXX method with different parameters types, as beanutils just looks for a method named "setXXX" without using parameter types. Nico. > Ivan De La Pena wrote: > > Hope this helps

Re: Problem with BeanUtils.copyProperties()

2004-01-02 Thread Patrick Scheuerer
Ivan De La Pena wrote: Hope this helps : Thanks Ivan, It did help :-). The problem I had was a bit strange: in my business object a had a method setSomeProperty(String[] data) and a method setSomeProperty(Vector data). copyProperties() called setSomeProperty(Vector data) on my business bean alth

RE: Problem with BeanUtils.copyProperties()

2004-01-01 Thread Ivan De La Pena
rties(bean2, bean); System.out.println(bean2.getArray()); PropertyUtils.copyProperties(bean3, mp); System.out.println(bean3.getArray()); } } Ivan -Original Message- From: Patrick Scheuerer [mailto:[EMAIL PROTECTED] Sent: Thursday, January 01, 2004 11:48 PM To: Struts

Problem with BeanUtils.copyProperties()

2004-01-01 Thread Patrick Scheuerer
Hi, Is it not possible to copy a String[] using BeanUtils.copyProperties()? My DynaValidatorForm has a field property like: My Business Bean has the following method: public void setSomeProperty(String[] data){ } Every time the copyProperty() method is

Re: BeanUtils.copyProperties() issue

2003-09-11 Thread Gregory Seidman
On Thu, Sep 11, 2003 at 09:04:11AM -0700, Mick Knutson wrote: } I have a Value Object that contains a starting java.util.Date and ending } java.util.Date. } I am using java.lang.String objects in my DynaForm and my JSP. } I currently add the dates to the DynaForm manually, and then perform a } copy

BeanUtils.copyProperties() issue

2003-09-11 Thread Mick Knutson
I have a Value Object that contains a starting java.util.Date and ending java.util.Date. I am using java.lang.String objects in my DynaForm and my JSP. I currently add the dates to the DynaForm manually, and then perform a copyProperties(). But the copyProperties fails with a type mismatch. So, wh

ActionForm-BeanUtils.copyProperties, null and default values

2003-04-04 Thread Budi Rostiarso
Hi, need help with ActionForm and BeanUtils.copyProperties. Basically, i want my POJO properties to be null if the associated ActionForm is empty string or null. But using BeanUtils.copyProperties, the destination gets its properties default values. for example in my POJO, Float property gets a

Re: BeanUtils.copyProperties between from and DAO issues

2003-03-21 Thread Dan Allen
Here it is: --- StringArrayConverter.java.orig 2003-03-21 04:43:17.0 -0500 +++ StringArrayConverter.java 2003-03-21 04:43:20.0 -0500 @@ -113,6 +113,10 @@ // --- Static Variables + /** +* Model object

Re: BeanUtils.copyProperties between from and DAO issues

2003-03-21 Thread Dan Allen
Dan Allen ([EMAIL PROTECTED]) wrote: > Mitchell Morris ([EMAIL PROTECTED]) wrote: > > > Hmmm ... looking in the BeanUtils javadocs, I see there's already an > > IntegerArrayConverter which turns a String[] into an int[]. Oh look! The > > author's name seems oddly familiar; anybody know some guy

Re: BeanUtils.copyProperties between from and DAO issues

2003-03-21 Thread Dan Allen
Mitchell Morris ([EMAIL PROTECTED]) wrote: > Hmmm ... looking in the BeanUtils javadocs, I see there's already an > IntegerArrayConverter which turns a String[] into an int[]. Oh look! The > author's name seems oddly familiar; anybody know some guy named "Craig R. > McClanahan"? > > just-need-to-

RE: BeanUtils.copyProperties between from and DAO issues

2003-03-16 Thread Mitchell Morris
e-ly y'rs, +Mitchell > -Original Message- > From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] > Sent: Sunday, March 16, 2003 9:21 PM > To: Struts Users Mailing List > Subject: RE: BeanUtils.copyProperties between from and DAO issues > > > > > On Sat, 15 Mar 2003,

RE: BeanUtils.copyProperties between from and DAO issues

2003-03-16 Thread Craig R. McClanahan
On Sat, 15 Mar 2003, Khalid K. wrote: > Date: Sat, 15 Mar 2003 13:21:01 -0800 > From: Khalid K. <[EMAIL PROTECTED]> > Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]> > To: 'Struts Users Mailing List' <[EMAIL PROTECTED]> > Subject: RE: BeanUtils

Re: BeanUtils.copyProperties between from and DAO issues

2003-03-15 Thread Vic Cekvenich
I see where you were going: #1. Post a request for enhancement in bugzilla for commons.(which will CC commons-dev), not in Struts, and not in User. #2. Wait a while. #3. Give up waiting, and extend BennUtils to do what you need it to do. #4. Submit a enhancement code to BeanUtils bugzila, thu

Re: BeanUtils.copyProperties between from and DAO issues

2003-03-15 Thread Dan Allen
Khalid K. ([EMAIL PROTECTED]) wrote: > If this is the case, I would think that > org.apache.commons.beanutils.BeanUtils should be modified to do String[] > to int[] conversion ??? > Thati s my 2 cents :) Thank you!! Me too. Okay, let's go with this! Devs? Also, when doing the conversion, any

RE: BeanUtils.copyProperties between from and DAO issues

2003-03-15 Thread Khalid K.
sers Mailing List Subject: RE: BeanUtils.copyProperties between from and DAO issues -Original Message- From: Dan Allen [mailto:[EMAIL PROTECTED] Sent: Saturday, March 15, 2003 9:14 AM To: Struts Users Mailing List Subject: Re: BeanUtils.copyProperties between from and DAO issues Right, b

RE: BeanUtils.copyProperties between from and DAO issues

2003-03-15 Thread Ken & Connie
-Original Message- From: Dan Allen [mailto:[EMAIL PROTECTED] Sent: Saturday, March 15, 2003 9:14 AM To: Struts Users Mailing List Subject: Re: BeanUtils.copyProperties between from and DAO issues Right, but I was hoping that perhaps it should do this conversion itself. Here's why

Re: BeanUtils.copyProperties between from and DAO issues

2003-03-15 Thread Dan Allen
as a signature public void setIndustryIds(int[] industryIds) {} my form has a field the BeanUtils.copyProperties doesn't see that these two properties should be linked, it simply doesn't call the setIndustryIds() method. Can

Re: BeanUtils.copyProperties between from and DAO issues

2003-03-15 Thread Vic Cekvenich
t as a java.lang.String[] since all form elements must be of type String (am I right?) Now, either I am populating from my form or populating to my form using BeanUtils.copyProperties(). It would appear as though the following conversion is failing horribly int[] --> String[] and String[] --&g

Re: BeanUtils.copyProperties between from and DAO issues

2003-03-15 Thread Dan Allen
as a > > java.lang.String[] since all form elements must be of type String > > (am I right?) > > > > Now, either I am populating from my form or populating to my form > > using BeanUtils.copyProperties(). It would appear as though the > > following conversion is failing

Re: BeanUtils.copyProperties between from and DAO issues

2003-03-15 Thread Vic Cekvenich
which I populate with all the industries from the database table. The multiple-select is set as a java.lang.String[] since all form elements must be of type String (am I right?) Now, either I am populating from my form or populating to my form using BeanUtils.copyProperties(). It would appear as

BeanUtils.copyProperties between from and DAO issues

2003-03-15 Thread Dan Allen
which I populate with all the industries from the database table. The multiple-select is set as a java.lang.String[] since all form elements must be of type String (am I right?) Now, either I am populating from my form or populating to my form using BeanUtils.copyProperties(). It would appear as

BeanUtils.copyProperties -error

2003-02-14 Thread Jack Zakarian
Hi, I have been trying to use BeanUtils.copyProperties in my Action to copy data from the ValidatorForm to the ServiceInvoiceHdr bean. I keep getting the following error message: "No value specified." I have searched the archives and spent 3 days on trying to solve this. Any hel

BeanUtils.copyProperties() vs. ActionForm-Value Object mapper

2003-02-04 Thread smart_runner23 <[EMAIL PROTECTED]>
at it doesn't handle Collection or ints, longs, etc is going to kill me. Anyone know of a better tool out there? Also, I am assuming that the BeanUtils.copyProperties() method will not handle nested beans. So I will have to manually do that copy properties on the nested beans and then ma

RE: Re[2]: Model Layer question.. where to put BeanUtils.copyProperties (sort of long)

2003-01-08 Thread Robert Taylor
eumann [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 08, 2003 5:22 PM > To: Struts Users Mailing List > Subject: Re[2]: Model Layer question.. where to put > BeanUtils.copyProperties (sort of long) > > > > > On Wednesday, January 8, 2003, 5:07:24 PM, Robert wrote: &

Re[3]: Model Layer question.. where to put BeanUtils.copyProperties (sort of long)

2003-01-08 Thread Rick Reumann
On Wednesday, January 8, 2003, 5:21:57 PM, Rick wrote: RR> On Wednesday, January 8, 2003, 5:07:24 PM, Robert wrote: RT>> If you are using DynaActionForm or DynaValidatorActionForm then you can RT>> cast the form to a DynaBean in your Action class and pass it to the business RT>> layer. RT>> Thi

Re[2]: Model Layer question.. where to put BeanUtils.copyProperties (sort of long)

2003-01-08 Thread Rick Reumann
On Wednesday, January 8, 2003, 5:11:59 PM, Juan wrote: AJc> Can you register the exceptions that beanutils throws in the AJc> struts config??? Actually I thought about doing that also. Might not be a bad idea. Each of my action mappings is going to start to get pretty large though:) -- Ric

Re[2]: Model Layer question.. where to put BeanUtils.copyProperties (sort of long)

2003-01-08 Thread Rick Reumann
On Wednesday, January 8, 2003, 5:07:24 PM, Robert wrote: RT> If you are using DynaActionForm or DynaValidatorActionForm then you can RT> cast the form to a DynaBean in your Action class and pass it to the business RT> layer. RT> This does not couple your business/service layer to Struts. It does

RE: Model Layer question.. where to put BeanUtils.copyProperties (sort of long)

2003-01-08 Thread Alvarado, Juan (c)
Can you register the exceptions that beanutils throws in the struts config??? -Original Message- From: Rick Reumann [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 08, 2003 4:57 PM To: Struts List Cc: model struts Subject: Model Layer question.. where to put BeanUtils.copyProperties

RE: Model Layer question.. where to put BeanUtils.copyProperties (sort of long)

2003-01-08 Thread Robert Taylor
> I don't really like the idea of passing the ActionForm into the > service layer since that couples the service layer to Struts, although > maybe that's not too big of a deal. If you are using DynaActionForm or DynaValidatorActionForm then you can cast the form to a DynaBean in your Action class a

Model Layer question.. where to put BeanUtils.copyProperties (sort of long)

2003-01-08 Thread Rick Reumann
hat most of my dispatch action methods have. The question I have though is where to best do the form/DTO conversion provided by BeanUtils.copyProperties(). To give you some background my current architecture looks like this (using JDBC)... JSP --- dispatch Action --- calls a Service class

Re: AW: BeanUtils.copyProperties(formBean, javaBean) not converting S trin g dates to java.util.Date dates

2002-10-19 Thread Rick Reumann
>> >> Hi, >> >> Struts1.1b2: BeanUtils.copyProperties(formBean, javaBean) not >> converting >> String properties into Dates: >> It will not covert them into java.util.Date. You need to create a Converter class to do it an register it. I just

AW: BeanUtils.copyProperties(formBean, javaBean) not converting Strin g dates to java.util.Date dates

2002-10-18 Thread sem . Gottofrey
Hi, have you tried the other way round? BeanUtils.copyProperties(javaBean, formBean) robert > -Ursprüngliche Nachricht- > Von: Clayson, Jim [mailto:Jim.Clayson@;centrica.co.uk] > Gesendet: Donnerstag, 17. Oktober 2002 18:38 > An: '[EMAIL PROTECTED]' > Betreff:

BeanUtils.copyProperties(formBean, javaBean) not converting String dates to java.util.Date dates

2002-10-18 Thread Clayson, Jim
Hi, Struts1.1b2: BeanUtils.copyProperties(formBean, javaBean) not converting String properties into Dates: I am trying to figure out what is wrong with what I am doing. I have a form bean with date string properties (from and to) which I would like to copy into a javabean class. When I print out

Re: Is BeanUtils.copyProperties meant to replace "mapping" utilities

2002-07-15 Thread Craig R. McClanahan
On Mon, 15 Jul 2002, Struts Newsgroup wrote: > Date: Mon, 15 Jul 2002 09:10:03 -0700 > From: Struts Newsgroup <[EMAIL PROTECTED]> > Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Subject: Is BeanUtils.copyProperties meant to

Is BeanUtils.copyProperties meant to replace "mapping" utilities

2002-07-15 Thread @Basebeans.com
Subject: Is BeanUtils.copyProperties meant to replace "mapping" utilities From: "Matt Raible" <[EMAIL PROTECTED]> === I'm currently using: http://www.mycgiserver.com/~andrej/technical/struts/struts.jsp Will BeanUtils.copyProperties do this same thing? Thanks