Well, fucked is a little strong... You can (and someone should, just not
me :-) ) create UI templates that will access the type conversion error
map to get the submitted values which could not be converted and
re-display them. 

> -----Original Message-----
> From: Mike Cannon-Brookes [mailto:[EMAIL PROTECTED] 
> Sent: Friday, December 12, 2003 5:30 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [OS-webwork] Empty string property now "" 
> instead of null?
> 
> 
> Well, that's why we almost always use Strings for critical 
> data - data conversion (like ints has many problems).
> 
> Chief among them IMHO is that if you have a textfield backed 
> by a get/set int method, and someone submits 'abc' - you're 
> fucked (regardless of whether it sets null, 0, -1 or any 
> other value) :)
> 
> (see Jason's mail a while ago about data conversion errors etc)
> 
> M
> 
> On 12/12/03 9:20 PM, "BOGAERT Mathias" 
> ([EMAIL PROTECTED]) penned the
> words:
> 
> > That is indeed a problem, but why would this be interesting 
> to know? I 
> > expect WebWork not to call any setters on my action (to set fields) 
> > when the form field is not filled (empty).
> > 
> > Also, if empty String resolves to "", why an empty Integer 
> to null and 
> > not new Integer(0)?
> > 
> > Mathias
> > 
> > -----Original Message-----
> > From: Mike Cannon-Brookes [mailto:[EMAIL PROTECTED]
> > Sent: vrijdag 12 december 2003 11:15
> > To: [EMAIL PROTECTED]
> > Subject: Re: [OS-webwork] Empty string property now "" instead of 
> > null?
> > 
> > 
> > _exactly_ - you put it perfectly mate.
> > 
> > So how do you tell the difference between a parameter, and not a 
> > parameter? (ie the text field never existed on the form at all) :)
> > 
> > Cheers,
> > Mike
> > 
> > On 12/12/03 8:59 PM, "BOGAERT Mathias" 
> ([EMAIL PROTECTED]) penned 
> > the
> > words:
> > 
> >> The problem here is that a HTML form ALWAYS submits parameters as 
> >> empty strings, you cannot 'not' send a parameter in.
> >> 
> >> Mathias
> >> 
> >> -----Original Message-----
> >> From: Dick Zetterberg [mailto:[EMAIL PROTECTED]
> >> Sent: vrijdag 12 december 2003 10:45
> >> To: [EMAIL PROTECTED]
> >> Subject: Re: [OS-webwork] Empty string property now "" instead of 
> >> null?
> >> 
> >> 
> >> In WW1.3 and 1.4 a string parameter that is empty will set 
> the string 
> >> property to the empty string. Not null. If your program choose to 
> >> interpret this as null that is up to you. How can you 
> otherwise see 
> >> the difference between a parameter that is not sent in at 
> all and one 
> >> that is sent in but is empty?
> >> 
> >> Cheers,
> >> 
> >> Dick Zetterberg
> >> [EMAIL PROTECTED]
> >> 
> >> ----- Original Message -----
> >> From: "Lars Fischer" <[EMAIL PROTECTED]>
> >> To: <[EMAIL PROTECTED]>
> >> Sent: Thursday, December 11, 2003 12:38 PM
> >> Subject: Re: [OS-webwork] Empty string property now "" instead of 
> >> null?
> >> 
> >> 
> >>> IMO it is essential that is is NULL. This has been a 
> problem with WW 
> >>> 1.2. and has been fixed in 1.3. It's perfectly legal for 
> a String to 
> >>> be null.
> >>> 
> >>> If WW2 handles this as an empty String, it's a bug.
> >>> 
> >>>> Hi,
> >>>> 
> >>>> When a form field (single textfield) is not filled, the request 
> >>>> param is an empty string, which translates to an empty 
> string array 
> >>>> (ParametersInterceptor), but my property setter is 
> called with an 
> >>>> empty string. Should't that be null?
> >>>> 
> >>>> Cheers,
> >>>> Mathias
> >> 
> >> 
> >> 
> >> -------------------------------------------------------
> >> 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
> >> 
> >> 
> >> -------------------------------------------------------
> >> 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
> > 
> > 
> > 
> > -------------------------------------------------------
> > 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
> > 
> > 
> > -------------------------------------------------------
> > 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
> 
> 
> 
> -------------------------------------------------------
> 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
> 


-------------------------------------------------------
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