--- 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/books/tutorial/java/nutsandbolts/datatypes.html

> e.g.
> public class TestFormBean extends ActionForm
> {
>     private String   stringProperty=null;
>     private Object[] arrayProperty=null;
> 
>     public  String   getStringProperty()
>    {
>      return (stringProperty);
>     }
>     public  void   setStringProperty(String stringProperty)
>     {
>       this.stringProperty = stringProperty;
>     }
> 
>     public  Object[] getArrayProperty()
>    {
>      return (arrayProperty);
>     }
>     public  void setArrayProperty(Object[] arrayProperty)
>     {
>       this.arrayProperty = arrayProperty;
>     }
> }
> 
> ----- Original Message -----
> From: "Andy" <[EMAIL PROTECTED]>
> 
> 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 configure
> something globally if possible.


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

Reply via email to