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

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-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 Martin Gainty
//easiest solution would be to set all the attribute default values to null e.g. public class TestFormBean extends ActionForm { private String stringProperty=null; private Object[] arrayProperty=null; public String getStringProperty() { return (stringProperty); } p

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