commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex" <alex.s...@partners.netfocus.es>
Subject RE: struts bean utils-problems with properties
Date Thu, 20 Oct 2005 07:34:44 GMT
First of all debug and see that personForm return what it is expceted.
If it is true, then be sure that all methods of personForm.getPerson()
names equals that in model, and third, (what i would do is debug
BeanUtils.copyProperties to see what is really executing.

If the problem persists i recomend you using Dozer API rather than
beanUtils.

-----Mensaje original-----
De: hem hem [mailto:hemanth3698@yahoo.com] 
Enviado el: jueves, 20 de octubre de 2005 9:30
Para: commons-user@jakarta.apache.org
Asunto: struts bean utils-problems with properties

Hi all,
i am new to this forum.this is my first post.i hope this mailing list
helps me.
 
in the first page in my struts web app, i need to enter the details of 5
persons.
they have proprties name,sex,rollnumber and age
for that i created a bean with these 4 properties which have getter and
setter methods in it.
then i instantiated the bean 5 times for the properties of 5 persons
the bean name is person
in my action form i instatiated like this:
Person person1=new Person();
Person person2=new Person();
Person person3=new Person(); and so on
in my jsp i used the property names as person1.name,person1.sex like
that.
 
so far its ok
but i need to populate the model objects from this form.
for that 
i used apache commons beanutils as below:
PersonModel is exactly the same bean as my Person bean with exactly the
same properties and same getter and setter methods.
but the datatypes of properties in PersonModel are diffrent from Person
bean(all the properties are Strings in Person but 2 are
Strings,1Long,1int in PersonModel)
PersonModel  person1Model=new PersonModel ();
 
BeanUtils.copyProperties(person1Model,personForm.getPerson1());
 
but this is failing to copy the properties and throwing
illegalargumentexception.
 
can anyone help how can i achieve this(copying properties)
it seems to be nested property problem.i am new to struts.
 
your suggestion are very much appreciated.
 
regards and thanks in advance




		
---------------------------------
 Yahoo! Music Unlimited - Access over 1 million songs. Try it free.


---------------------------------------------------------------------
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