Struts1 forms with empty Strings

2008-02-29 Thread Andy
Hi, I was wondering if there is a way to configure Struts1 so Form beans return null values instead of empty String values when a user does not enter data in a text field, for example. The problem is that Hibernate then saves empty Strings to the database instead of nulls. I would like to conf

Re: Struts1 forms with empty Strings

2008-02-29 Thread Dave Newton
--- Andy <[EMAIL PROTECTED]> wrote: > I was wondering if there is a way to configure Struts1 so Form beans return > null values instead of empty String values when a user does not enter data > in a text field, for example. The problem is that Hibernate then saves > empty Strings to the database in

Re: Struts1 forms with empty Strings

2008-02-29 Thread Martin Gainty
; } } Anyone else? M- - Original Message - From: "Andy" <[EMAIL PROTECTED]> To: Sent: Friday, February 29, 2008 1:58 PM Subject: Struts1 forms with empty Strings Hi, I was wondering if there is a way to configure Struts1 so Form beans return null values instead of emp

Re: Struts1 forms with empty Strings

2008-02-29 Thread Dave Newton
--- Martin Gainty <[EMAIL PROTECTED]> wrote: > //easiest solution would be to set all the attribute default values to null Isn't that the default value for a String field? [1] Does this prevent and empty value from the HTML form being set on the ActionForm? Dave [1] http://java.sun.com/docs/boo

Re: Struts1 forms with empty Strings

2008-02-29 Thread Randy Burgess
gt; Reply-To: Struts Users Mailing List > Date: Fri, 29 Feb 2008 12:53:36 -0800 (PST) > To: Struts Users Mailing List > Subject: Re: Struts1 forms with empty Strings > > --- Martin Gainty <[EMAIL PROTECTED]> wrote: >> //easiest solution would be to set all the attribute def

Re: Struts1 forms with empty Strings

2008-03-01 Thread Tim B
"Dave Newton" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > --- Andy <[EMAIL PROTECTED]> wrote: > > I was wondering if there is a way to configure Struts1 so Form beans return > > null values instead of empty String values when a user does not enter data > > in a text field, for ex

Fw: Struts1 forms with empty Strings

2008-03-01 Thread Martin Gainty
ng example=null; .. }; //class ??? Martin-- - Original Message - From: "Tim B" <[EMAIL PROTECTED]> To: Sent: Saturday, March 01, 2008 9:44 PM Subject: Re: Struts1 forms with empty Strings > > "Dave Newton" <[EMAIL PROTECTED]> wrote in message > ne

Re: Fw: Struts1 forms with empty Strings

2008-03-01 Thread Dave Newton
--- Martin Gainty <[EMAIL PROTECTED]> wrote: > Tim and Dave > /what about creating your own WhateverFormBean and setting all attribs to > null as default instead of empty string e.g. > WhateverFormBean extends FormBeanConfig { > /** > * An example String property. > */ > //change >