Re: COMPARING PROPERTY VALUES OF TWO JAVABEANS ...please help

2004-09-21 Thread O. Oke
Erik and Frank, Thanks. I would consider your suggestions. Ola. --- "Frank W. Zammetti (MLists)" <[EMAIL PROTECTED]> wrote: > Erik's answer is what I would call the correct > one... That being said, if > for some reason you don't want to use that approach, > I don't think there's > anything

Re: COMPARING PROPERTY VALUES OF TWO JAVABEANS ...please help

2004-09-20 Thread Craig McClanahan
On Sun, 19 Sep 2004 19:17:25 -0400 (EDT), Frank W. Zammetti (MLists) <[EMAIL PROTECTED]> wrote: > Erik's answer is what I would call the correct one... I agree as well, but just wanted to point out one additional detail ... if you override the equals() method, you will probably also want to over

Re: COMPARING PROPERTY VALUES OF TWO JAVABEANS ...please help

2004-09-19 Thread Frank W. Zammetti (MLists)
Erik's answer is what I would call the correct one... That being said, if for some reason you don't want to use that approach, I don't think there's anything specifically in Struts to do what you want anyway, but you might want to have a look through the Commons BeanUtils packages. If such a thing

Re: COMPARING PROPERTY VALUES OF TWO JAVABEANS ...please help

2004-09-19 Thread Erik Weber
Why don't you just override the equals method in your bean class? public boolean equals(Object o) { if (!(o instanceof MyClass)) return false; MyClass bean = (MyClass) o; if (!(name.equals(bean.name))) return false; if (!(sex.equals(bean.sex))) return false; //etc. . . return true; } Then y

COMPARING PROPERTY VALUES OF TWO JAVABEANS ...please help

2004-09-19 Thread O. Oke
Please, I want find out if the value of each of the matching properties in two beans are the same. BACKGROUND == I have two JAVABEANS A AND B. They both have name and sex properties amongst others. I want to find out if A.name == B.name and A.sex == B.sex. Is there any method in Struts