I filed this:
https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=323

the JSF EG worked around it, but still the issue is present in standalone JSP.

-M

On Wed, Oct 15, 2008 at 10:00 AM, Matthias Wessendorf <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I know. This is an issue w/ the JSP spec;
> For instance, String is also not null, it become "" ...
>
> I strongly suggest to talk to the following EGs:
> -JSP
> -JSF
>
> -Matthias
>
> On Tue, Oct 14, 2008 at 9:52 PM, aruben <[EMAIL PROTECTED]> wrote:
>>
>> Hello,
>>
>> i migrated my webapp to jsf 1.2 and encountered an problem with the setting
>> of my backing bean properties.
>>
>> When i submit a form with no values entered, the backing bean properties
>> (Double, Long, Number) are filled with 0.0 instead of null.
>>
>> I found the following lines of code in the class
>> org.apache.el.lang.ELSupport:
>>
>>  private final static Long ZERO = new Long(0L);
>>
>>  public final static Number coerceToNumber(final Object obj) {
>>        if (obj == null) {
>>            return ZERO;
>>        } else if (obj instanceof Number) {
>>            return (Number) obj;
>>        } else {
>>            String str = coerceToString(obj);
>>            if (isStringFloat(str)) {
>>                return toFloat(str);
>>            } else {
>>                return toNumber(str);
>>            }
>>        }
>>    }
>>
>> Why the return ZERO ? On the jspx i see the 0.0 in the input fields. When i
>> now submit the site the 0.0 values are saved in my database. But the values
>> should be set to null.
>> Are there any workarounds for this problem.
>>
>> Thanks for the help
>> Alex
>>
>>
>> tomcat-6.0.16
>> facelet´s
>>
>> used jar´s:
>>
>> activation_1.1.jar
>> antlr-2.7.6.jar
>> asm_1.5.3.jar
>> aspectjweaver-1.5.jar
>> c3p0-0.9.0.jar
>> cglib-2.1.3.jar
>> commons-beanutils-1.7.0.jar
>> commons-codec-1.3.jar
>> commons-collections-3.2.jar
>> commons-dbcp-1.2.2.jar
>> commons-digester-1.8.jar
>> commons-discovery-0.4.jar
>> commons-el-1.0.jar
>> commons-email-1.1.jar
>> commons-fileupload-1.2.jar
>> commons-io-1.3.2.jar
>> commons-lang-2.4.jar
>> commons-logging-1.0.4.jar
>> commons-pool-1.3.jar
>> commons-validator-1.3.1.jar
>> dom4j-1.6.1.jar
>> dto-beanprocessor-0.2.jar
>> ehcache-1.3.0.jar
>> ejb3-persistence-3.2.jar
>> fop_0.94.jar
>> hibernate-3.2.6.jar
>> hibernate-annotations-3.3.1.jar
>> hibernate-commons-annotations-3.2.jar
>> hibernate-entitymanager-3.3.2.jar
>> jaf-1_1-fr.zip
>> jakarta-oro-2.0.8.jar
>> jsf-facelets_1.1.14.jar
>> jstl-1.2.jar
>> jta_1.1.jar
>> junit_3.8.1.jar
>> log4j-1.2.14.jar
>> mail_1.4.1.jar
>> myfaces-api-1.2.4.jar
>> myfaces-impl-1.2.4.jar
>> mysql-connector-java-5.0.8-bin.jar
>> mysql-connector-java-5.1.6-bin.jar
>> richfaces-api-3.2.2.GA.jar
>> richfaces-impl-3.2.2.GA.jar
>> richfaces-ui-3.2.2.GA.jar
>> spring-2.1.jar
>> tomahawk12-1.1.7.jar
>> xmlgraphics-commons-1.2.jar
>>
>> --
>> View this message in context: 
>> http://www.nabble.com/bean-properties-are-set-with-0.0-instead-of-null-tp19980936p19980936.html
>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>
>>
>
>
>
> --
> Matthias Wessendorf
>
> blog: http://matthiaswessendorf.wordpress.com/
> sessions: http://www.slideshare.net/mwessendorf
> twitter: http://twitter.com/mwessendorf
>



-- 
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf

Reply via email to