You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Stefan Berger <st...@softborg.com> on 2003/08/18 10:58:28 UTC

Form data is not null and the length is 0 --> why this ?

    Hi,
 
I am confused. I have a form with fields and after pressing the button i
got a surprise.
 
My Form:
String field; and the get/set Methode
 
When this field is  not filled --> the form says the field is not null
but the length is 0 why that ?
 
Regards Stefan
 
 

Re: Form data is not null and the length is 0 --> why this ?

Posted by Jing Zhou <ji...@netspread.com>.
This is the default behaviors of browsers (at least in IE as I know)
Successful controls (the HTML terms for your form fields) will be sent over
with name/value pairs when a form is submitted. So if you get a name,
you must have a value, at least the empty string. There is no *null* concept
in a field's value in HTML. But there is a concept of
successful/non-successful
controls.

Jing
Netspread Carrier
http://www.netspread.com


----- Original Message ----- 
From: "Stefan Berger" <st...@softborg.com>
To: <st...@jakarta.apache.org>
Sent: Monday, August 18, 2003 3:58 AM
Subject: Form data is not null and the length is 0 --> why this ?


>     Hi,
>
> I am confused. I have a form with fields and after pressing the button i
> got a surprise.
>
> My Form:
> String field; and the get/set Methode
>
> When this field is  not filled --> the form says the field is not null
> but the length is 0 why that ?
>
> Regards Stefan
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Form data is not null and the length is 0 --> why this ?

Posted by Firat TIRYAKI <fi...@pleksus.com.tr>.
null means the related object has no reference, it has no memory allocation,
and it has no value.

A string may have 0 length but may be referenced in the memory area, so null
doesn't mean 0 length in strings.

F.

----- Original Message ----- 
From: "Stefan Berger" <st...@softborg.com>
To: <st...@jakarta.apache.org>
Sent: Monday, August 18, 2003 11:58 AM
Subject: Form data is not null and the length is 0 --> why this ?


>     Hi,
>
> I am confused. I have a form with fields and after pressing the button i
> got a surprise.
>
> My Form:
> String field; and the get/set Methode
>
> When this field is  not filled --> the form says the field is not null
> but the length is 0 why that ?
>
> Regards Stefan
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: Form data is not null and the length is 0 --> why this ?

Posted by Andrew Hill <an...@gridnode.com>.
"" != null

-----Original Message-----
From: Stefan Berger [mailto:stefan.berger@softborg.com]
Sent: Monday, 18 August 2003 16:58
To: struts-user@jakarta.apache.org
Subject: Form data is not null and the length is 0 --> why this ?


    Hi,
 
I am confused. I have a form with fields and after pressing the button i
got a surprise.
 
My Form:
String field; and the get/set Methode
 
When this field is  not filled --> the form says the field is not null
but the length is 0 why that ?
 
Regards Stefan
 
 


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org