myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gerhard <gerhard.petra...@gmail.com>
Subject Re: NPE in Required Initialization for labels addon (property version)
Date Thu, 28 Oct 2010 16:23:08 GMT
hi ben,

i've committed both - see [1]

regards,
gerhard

[1] http://code.google.com/p/os890/source/detail?r=378

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces


2010/10/28 <neumanb@ijet.com>

>  Great, I see the change in the bean-validation version.
> Don't forget the property version ;)
>
> # This patch file was generated by NetBeans IDE
> # It uses platform neutral UTF-8 encoding and \n newlines.
> --- Base (BASE)
> +++ Locally Modified (Based On LOCAL)
> @@ -117,8 +117,11 @@
>
>          }
>          else
>          {
> +            String value = (String) uiOutput.getValue();
> +            if (value != null) {
>              applyRequiredMarkerUsingValue(facesContext, uiOutput, (String)
> uiOutput.getValue());
>          }
> +        }
>          if (setEscapeToFalse)
>          {
>              doSetEscapeToFalse(uiOutput);
> --Ben
>
> -----Original Message-----
> *From:* Gerhard [mailto:gerhard.petracek@gmail.com]
> *Sent:* Wednesday, October 27, 2010 6:32 PM
> *To:* MyFaces Development
> *Subject:* Re: NPE in Required Initialization for labels addon (property
> version)
>
> thx ben - i've committed it.
>
> regards,
> gerhard
>
> http://www.irian.at
>
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>
>
>
> 2010/10/27 <neumanb@ijet.com>
>
>>  This null-check was also needed in the Bean Validation version.
>>
>> Thanks!
>> Ben
>>
>> -----Original Message-----
>> *From:* Ben Neuman
>> *Sent:* Wednesday, October 27, 2010 11:31 AM
>> *To:* 'MyFaces Development'
>> *Subject:* NPE in Required Initialization for labels addon (property
>> version)
>>
>> I had to make a small change in the Required Initialization for labels
>> (property version) to resolve a NullPointerException.
>>
>> In DefaultRequiredLabelInitializer I added a null value check. Without, I
>> was getting NullPointerExceptions.
>>
>> protected void applyRequiredMarker(FacesContext facesContext, UIOutput
>> uiOutput)
>> {
>>     ValueExpression expression = uiOutput.getValueExpression("value");
>>
>>         if (expression != null)
>>         {
>>             applyRequiredMarkerUsingExpression(facesContext, uiOutput,
>> expression.getExpressionString());
>>         }
>>         else
>>         {
>>             String value = (String) uiOutput.getValue();
>>             if (value != null) {
>>                 applyRequiredMarkerUsingValue(facesContext, uiOutput,
>> value);
>>             }
>>         }
>>         ...
>> }
>>
>> Thanks!
>> Ben
>>
>>
>

Mime
View raw message