Hi,

Since 0 would be the default value for primitive int, you cant do any
thing over there. But if you are using Integer object then youc an get
null.
In the formBean you would have instantiated the fields globally. Check
that.
Ex :
String s = ""; or String s = new String("") ;

If so then you got to change it to
String s = null;

Then you would get it as null.

Hope this helps you.
Anil.

-----Original Message-----
From: Sandra Reichert [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 13, 2006 1:10 PM
To: Struts Users Mailing List
Subject: empty fields of an input form get default value after
submitting

Hi,

I have an input form in jsp. After submitting empty fields (user entered
nothing in input field) are set by default with specific values
depending on their data typ.
So an empty Integer field is set to 0, an String field to "" an so on.

But i want to have a null value for empty fields.
Or in other words: How can i decide if for example the 0 is entered by
user or the default initialization.

Can anybody help ....


Thanks
Sandra Reichert



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


Information transmitted by this e-mail is proprietary to Infinite Computer 
Solutions and / or its Customers and is intended for use only by the individual 
or the entity to which it is addressed, and may contain information that is 
privileged, confidential or exempt from disclosure under applicable law. If you 
are not the intended recipient or it appears that this mail has been forwarded 
to you without proper authority, you are notified that any use or dissemination 
of this information in any manner is strictly prohibited. In such cases, please 
notify us immediately at [EMAIL PROTECTED] and delete this email from your 
records.

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

Reply via email to