You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Veit Guna (JIRA)" <de...@myfaces.apache.org> on 2006/02/26 13:48:54 UTC

[jira] Created: (MYFACES-1156) Model update uses empty string instead of null. Custom String converter not possible.

Model update uses empty string instead of null. Custom String converter not possible. 
--------------------------------------------------------------------------------------

         Key: MYFACES-1156
         URL: http://issues.apache.org/jira/browse/MYFACES-1156
     Project: MyFaces Core
        Type: Improvement
    Versions: 1.1.2-SNAPSHOT    
 Environment: Windows XP SP2, Tomcat 5.5, Myfaces 1.1.2-SNAPSHOT, Hibernate 3.1.2, Facelets 0.8
    Reporter: Veit Guna


I've encountered a problem using String values with myfaces. The default behavior of myfaces (probably jsf?) seems to be, that Input values of type String
get converted to an empty String (""). Instead I would like to have a null value updated in my model. This is because I don't want to have
empty Strings in my DB - but nulls.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (MYFACES-1156) Model update uses empty string instead of null. Custom String converter not possible.

Posted by "Mike Kienenberger (JIRA)" <de...@myfaces.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-1156?page=all ]
     
Mike Kienenberger resolved MYFACES-1156:
----------------------------------------

    Resolution: Won't Fix

Unfortunately, this can't change until the JSF spec changes since the spec disallows custom String converters.

You can add your own comments on this matter to the following JSF issue.

https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=131



> Model update uses empty string instead of null. Custom String converter not possible.
> -------------------------------------------------------------------------------------
>
>          Key: MYFACES-1156
>          URL: http://issues.apache.org/jira/browse/MYFACES-1156
>      Project: MyFaces Core
>         Type: Improvement
>     Versions: 1.1.2-SNAPSHOT
>  Environment: Windows XP SP2, Tomcat 5.5, Myfaces 1.1.2-SNAPSHOT, Hibernate 3.1.2, Facelets 0.8
>     Reporter: Veit Guna

>
> I've encountered a problem using String values with myfaces. The default behavior of myfaces (probably jsf?) seems to be, that Input values of type String
> get converted to an empty String (""). Instead I would like to have a null value updated in my model. This is because I don't want to have
> empty Strings in my DB - but nulls.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-1156) Model update uses empty string instead of null. Custom String converter not possible.

Posted by "Wells Tiedeman (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-1156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12486192 ] 

Wells Tiedeman commented on MYFACES-1156:
-----------------------------------------

This issue has been addressed in the JSF RI:
https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=131

Can you fix it for MyFaces?

> Model update uses empty string instead of null. Custom String converter not possible.
> -------------------------------------------------------------------------------------
>
>                 Key: MYFACES-1156
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1156
>             Project: MyFaces Core
>          Issue Type: Improvement
>    Affects Versions: 1.1.2-SNAPSHOT
>         Environment: Windows XP SP2, Tomcat 5.5, Myfaces 1.1.2-SNAPSHOT, Hibernate 3.1.2, Facelets 0.8
>            Reporter: Veit Guna
>
> I've encountered a problem using String values with myfaces. The default behavior of myfaces (probably jsf?) seems to be, that Input values of type String
> get converted to an empty String (""). Instead I would like to have a null value updated in my model. This is because I don't want to have
> empty Strings in my DB - but nulls.

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


[jira] Commented: (MYFACES-1156) Model update uses empty string instead of null. Custom String converter not possible.

Posted by "Veit Guna (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-1156?page=comments#action_12367821 ] 

Veit Guna commented on MYFACES-1156:
------------------------------------

Sorry, I forgot to mention, that using a custom String converter doesn't work.

--cut here--
        Class valueType = vb.getType(facesContext);
        if (valueType == null) return null;

        if (String.class.equals(valueType)) return null;    //No converter needed for String type
        if (Object.class.equals(valueType)) return null;    //There is no converter for Object class
--cut here--


> Model update uses empty string instead of null. Custom String converter not possible.
> -------------------------------------------------------------------------------------
>
>          Key: MYFACES-1156
>          URL: http://issues.apache.org/jira/browse/MYFACES-1156
>      Project: MyFaces Core
>         Type: Improvement
>     Versions: 1.1.2-SNAPSHOT
>  Environment: Windows XP SP2, Tomcat 5.5, Myfaces 1.1.2-SNAPSHOT, Hibernate 3.1.2, Facelets 0.8
>     Reporter: Veit Guna

>
> I've encountered a problem using String values with myfaces. The default behavior of myfaces (probably jsf?) seems to be, that Input values of type String
> get converted to an empty String (""). Instead I would like to have a null value updated in my model. This is because I don't want to have
> empty Strings in my DB - but nulls.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira