"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
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
--- 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
//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
--- 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
5 matches
Mail list logo