4 Replies Latest reply on May 15, 2011 11:58 AM by lafr

    Null Integer/String converted to default objects?

    arnoldussen

      Hi,

       

      i am implementing search functionality for objects from the database. All is fine except for the specification of a null value for any Integer or String property of the object. Whenever a null value is passed for either of these they will be instantiated as empty string or Integer(0).

       

      I have tried specifying the context parameter to allow null strings to be submitted:

          <context-param>

              <param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name>

              <param-value>true</param-value>

          </context-param>

       

      but this has no effect (i was hoping this would work for both strings and integers, but it works for neither).

       

      I considered adding a converter to change strings to null, but then i would still have a problem for the Integer field(s). I can't turn 0 into null because sometimes the value to be searched is 0 ...

       

      I am using JBoss AS  6.0.0.Final (with it's standard Mojarra implementation 2.0.3)

       

      Ãny ideas on how to achieve a working solution are most welcome!