tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Menard (JIRA)" <...@tapestry.apache.org>
Subject [jira] Commented: (TAPESTRY-2085) Empty textfield submits null value
Date Sat, 26 Jan 2008 18:42:34 GMT

    [ https://issues.apache.org/jira/browse/TAPESTRY-2085?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12562900#action_12562900

Kevin Menard commented on TAPESTRY-2085:

I'm not really sure what point you're arguing.  The core of the matter is things that used
to work no longer do and there's no trivial way to get around that.

As for null versus empty . . . I guess it's a matter of taste, but the value POST'd is not
null.  There's a translation going on there and it's not symmetric.

I guess at the very least, the expectation is that you're given a value.  I think this is
consistent with nearly all other Web frameworks in all other languages.  Of course, I haven't
tried them all, but I'm drawing from the experience I've had with a decent number of others.
 Call it an application of the Null Object pattern if you may.

Anyway, it sounds like Howard has a decent idea of how this ought to be addressed, although,
based on the varying opinions of correct behavior, it likely isn't going to be a fun one.

> Empty textfield submits null value
> ----------------------------------
>                 Key: TAPESTRY-2085
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2085
>             Project: Tapestry
>          Issue Type: Bug
>    Affects Versions: 5.0.10
>            Reporter: Kevin Menard
>            Priority: Critical
> This was initially reported on the dev list by Geoff Callender.
> When submitting a form containing a textfield and nothing has been typed into that textfield,
the value will be submitted as null rather than the empty string.  In past version, the empty
string would be submitted.
> The net result is NPEs and coercion issues.  If the textfield is bound to a String and
that String is used without checking for null, an NPE will result when none used to.  If the
textfield is bound to any other type, such as an Integer, the Tapestry type coercer will fail
with an appropriate exception (e.g., NumberFormatException).

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

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

View raw message