Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 877923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:41:22+00:00 2026-05-15T11:41:22+00:00

We are using a h:inputText in a JSF page which is bound to an

  • 0

We are using a h:inputText in a JSF page which is bound to an Integer property (and thus can accept null). When there is no value written in the h:inputText, the form is submitting a 0 instead of null. We are using Trinidad 1.2.2 and Tomcat 6.0.20 (we also tried with Tomcat 6.0.14 as we read that this could happen with certains Tomcat versions).

How is this caused and how can I solve it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T11:41:22+00:00Added an answer on May 15, 2026 at 11:41 am

    This "feature" was result of a bugfix in EL which was introduced as per Tomcat 6.0.16. As per chapter 1.18.3 of the EL specification, a value of number type which is null should be coerced to 0. Before Tomcat 6.0.16 this was "incorrectly" been coerced to an empty string.

    After all, an empty string was actually much more intuitive than a zero. The Tomcat guys at Apache got a lot complaints about this bugfix, so they introduced a new configuration setting in flavor of a VM argument as per Tomcat 6.0.17 which would disable this bugfix.

    -Dorg.apache.el.parser.COERCE_TO_ZERO=false

    I’ve by the way requested a change to this spec that it should only coerce empty/null primitive types to zero and empty/null non-primitive java.lang.Number types to empty string: JSP EL issue 184. They did not much with it, but the issue at least got a lot of votes. Who knows… This behaviour is at least indeed pretty annoying because it’s non-intuitive.

    See also:

    • The empty String madness
    • How to make number input area initially empty instead of 0 or 0.00?
    • How to set -Dorg.apache.el.parser.COERCE_TO_ZERO=false programmatically
    • Work around for faulty INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL in Mojarra JSF 2.1
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using PyObjC , you can use Python to write Cocoa applications for OS X.
Using ASP.NET MVC there are situations (such as form submission) that may require a
Using C# and System.Data.SqlClient, is there a way to retrieve a list of parameters
Using VS2008, C#, .Net 2 and Winforms how can I make a regular Button
When facing the problem of validating a property in a JSF2 application there are
I am using JSF validation to simply check that the length of a field
In a JSP page, I created a <h:form enctype=multipart/form-data> with some elements: <t:inputText> ,
I'm using JSF 2.0 and it's new (actually old, but now incorporated in JSF)
Using online interfaces to a version control system is a nice way to have
Using C# .NET 3.5 and WCF, I'm trying to write out some of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.