You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Inge Solvoll <in...@gmail.com> on 2006/11/30 14:52:57 UTC

Empty string becomes null on submit

I've suddenly gotten a problem in my code. When I enter nothing into a text
field on a tapestry page and submit, the corresponding abstract getter
method returns null instead of empty string "". I have checked my code, and
nothing has changed, this used to work before. I haven't upgraded any of the
jar files for tapestry or tacos or something like that.

One thing has changed: I've started using UTF-8 encoding for my webapp. I
have a filter that enforces characterEncoding UTF-8, and my html and
.application file are also configured to use UTF-8. I'm suspecting the
Unicode changes to cause this strange null-behaviour, but I don't know what
to do. I've tried rolling back to ISO-8859-1 like before, but nothing
happens. Don't know if I managed to remove all UTF-8 references completely
though.

Has anyone experienced something similar? Is this an encoding issue or is it
something else?

Re: Empty string becomes null on submit

Posted by Inge Solvoll <in...@gmail.com>.
Actually, I didn't expect this behaviour. And I'm pretty sure it worked a
couple of months ago. It seems perfectly natural to me that an empty string
submitted from the user should actually become an empty string in java.

Inge

On 11/30/06, Ron Piterman <rp...@gmx.net> wrote:
>
> afaik this is the normal behaviour: empty fields set the property to null.
>
> Cheers,
> Ron
>
> Inge Solvoll wrote:
> > I've suddenly gotten a problem in my code. When I enter nothing into a
> text
> > field on a tapestry page and submit, the corresponding abstract getter
> > method returns null instead of empty string "". I have checked my code,
> and
> > nothing has changed, this used to work before. I haven't upgraded any of
> > the
> > jar files for tapestry or tacos or something like that.
> >
> > One thing has changed: I've started using UTF-8 encoding for my webapp.
> I
> > have a filter that enforces characterEncoding UTF-8, and my html and
> > .application file are also configured to use UTF-8. I'm suspecting the
> > Unicode changes to cause this strange null-behaviour, but I don't know
> what
> > to do. I've tried rolling back to ISO-8859-1 like before, but nothing
> > happens. Don't know if I managed to remove all UTF-8 references
> completely
> > though.
> >
> > Has anyone experienced something similar? Is this an encoding issue or
> > is it
> > something else?
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Empty string becomes null on submit

Posted by Ron Piterman <rp...@gmx.net>.
afaik this is the normal behaviour: empty fields set the property to null.

Cheers,
Ron

Inge Solvoll wrote:
> I've suddenly gotten a problem in my code. When I enter nothing into a text
> field on a tapestry page and submit, the corresponding abstract getter
> method returns null instead of empty string "". I have checked my code, and
> nothing has changed, this used to work before. I haven't upgraded any of 
> the
> jar files for tapestry or tacos or something like that.
> 
> One thing has changed: I've started using UTF-8 encoding for my webapp. I
> have a filter that enforces characterEncoding UTF-8, and my html and
> .application file are also configured to use UTF-8. I'm suspecting the
> Unicode changes to cause this strange null-behaviour, but I don't know what
> to do. I've tried rolling back to ISO-8859-1 like before, but nothing
> happens. Don't know if I managed to remove all UTF-8 references completely
> though.
> 
> Has anyone experienced something similar? Is this an encoding issue or 
> is it
> something else?
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org