You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Thomas Andraschko (Jira)" <de...@myfaces.apache.org> on 2020/02/19 10:45:00 UTC

[jira] [Commented] (MYFACES-4319) Null submitted values handling error

    [ https://issues.apache.org/jira/browse/MYFACES-4319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17039895#comment-17039895 ] 

Thomas Andraschko commented on MYFACES-4319:
--------------------------------------------

Can you please provide a sample maven project? (you can fork primefaces-test on github, then we can compare easily the behavior of myfaces vs mojarra)

> Null submitted values handling error
> ------------------------------------
>
>                 Key: MYFACES-4319
>                 URL: https://issues.apache.org/jira/browse/MYFACES-4319
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 2.3.6
>         Environment: Open Liberty 20.0.0.1
>            Reporter: Fabrício Fonseca
>            Priority: Major
>
> When running MyFaces with it seems like an error occurs preventing "Process Validations" phase to execute if you try to submit empty string values. 
>  
> I found out when trying to use the TrimConverter utility class from the OmniFaces library. This is a Faces Converter which trim all submitted string values. If the trimmed value has a length of 0, the converter returns null. Whenever i try to submit a form leaving the fields empty, the properties of the backing bean are not getting validated neither the bean method associated with the submit action is invoked. The form is rendered again. 
>  
> Steps to reproduce:
>  
> 1- Create a form with some fields linked with corresponding backing bean string properties;
>  
> 2 - Add @NotNull constraint to the backing bean properties;
>  
> 3 - Create a Faces Converter which converts empty string values to null. Attach the converter to java.lang.String class (through faces-config <converter-for-class> element)
>  
> 4 - Run the project and try to submit empty string values;
>  
>  
> Please note this error may be related to this: https://stackoverflow.com/questions/56279977/blank-input-string-fields-submitted-as-empty-strings-vs-null-jsf-2-3-myfaces
>  
>  
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)