If your Database values are null then the corresponding Object should be
null and not an Object Reference.

Make sure when you read a ResultSet you call

Integer column = null;

int tmpColumn = results.getInteger("COLUMN");
if(!results.wasNull()) {
        // I think it is wasNull(). You don't need to worry about it with
Strings.
        column = new Integer(tmpColumn);
}

// Assuming column was the property you were attempting to populate your
form with using BeanUtils.

I placed a method in my DBHelper for all the data type gets to avoid
duplicating all this code.

-----Original Message-----
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Randy Kennedy
Sent: 20 May 2005 13:20
To: user@struts.apache.org
Subject: Easy form populate question for gurus

Why does an object reference (e.g. [EMAIL PROTECTED]) show up in 
my text fields when I prepopulate the form using Jakarta commons 
BeanUtils.copyProperties(...)?  The values in the database are null, and 
I know this has something to do with it, so I guess my real question is, 
"How do I fix it?".

--
Randy Kennedy
Appriss, Inc.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to