----- Original Message ----- 
From: "Mathias Berg" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, December 12, 2003 11:18 AM
Subject: RE: [OS-webwork] Empty string property now "" instead of null?


> A question, why is Long parameters from the FORM set to null, and not
> String? Cant it be set to Long(0) then?
> 
> /Mathias.
> 

How can you then see the difference if the user typed in the value 0 or if the user 
did not type in anything?
Before WW1.4 an empty string parameter for a Long (or long for that matter) property 
resulted in an exception. It was changed in WW1.4 so that for Long it now results in a 
null value. This was changed so that you can have the possibility to decide if a null 
value is ok or not during validation.

Anyway, just to clarify, this whole discussion is about the DEFAULT behaviour of 
webwork (I'm talking about WW1 because that's what I know)
If you do not like the default way numbers or strings are set, then you just register 
your own property editor with the PropertyEditorManager for the classes you wish to 
change. 
If you want to handle some type in a special way in a class then create a BeanInfo 
class for your action (as described in the WW manual), or just use String properties 
in your action and then convert them manually to whatever types you will be using.

Cheers,

Dick Zetterberg
[EMAIL PROTECTED]




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to