Tuesday, May 27, 2003 01:17 AM
It is not because of struts that you get empty strings this is standard http behaviour. If you don't type a value in you're text field (client side), the server get a key=value pail like 'textfieldName=' and it is automatically interpretated as an empty string.
But why do you need to make a difference between a null value or an empty string, both indicate that the user didn't give any value to that textfield.
If you really want a null value in the Form Bean make sure that the key that maps on the setter of in Form Bean isn't present in the http request and set the field in the reset method of you're Form Bean to null.
If you don't use the reset method, the first time the field will get the initial value set in you're Form Bean when you declared it and if in a request the field get a value it will keep this value until it session invalidates.