[ 
https://issues.apache.org/jira/browse/EXTVAL-102?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gerhard Petracek resolved EXTVAL-102.
-------------------------------------

    Fix Version/s: 2.0.4-SNAPSHOT
       Resolution: Fixed

> NullPointerException during resolvment of nested EL expression for custom 
> component attribute
> ---------------------------------------------------------------------------------------------
>
>                 Key: EXTVAL-102
>                 URL: https://issues.apache.org/jira/browse/EXTVAL-102
>             Project: MyFaces Extensions Validator
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.3
>         Environment: Mojarra 2.0.2
>            Reporter: Tom M.
>            Priority: Minor
>             Fix For: 2.0.4-SNAPSHOT
>
>         Attachments: TestProject.war
>
>
> Origin: 
> http://markmail.org/message/fo4q5mbbcrzsumed?q=list:org%2Eapache%2Emyfaces%2Eusers
> Workaround: use EL expressions of a) or b) or use a custom ELHelper 
> implementation (e.g. the fixed version which is available in the myfaces-svn)
> Hi,
> the following NPE occured using Myfaces ExtVal:
> java.lang.NullPointerException at 
> javax.faces.component.UIComponent.getValueExpression(UIComponent.java:338) at
> com.sun.faces.el.CompositeComponentAttributesELResolver$ExpressionEvalMap.getExpression(CompositeComponentAttributesELResolver.java:314)
>  at
> org.apache.myfaces.extensions.validator.core.el.ExtValELResolver.getCompositeComponentExpression(ExtValELResolver.java:277)
>  at
> org.apache.myfaces.extensions.validator.core.el.DefaultELHelper.getPropertyDetailsOfValueBinding(DefaultELHelper.java:169)
>  at
> org.apache.myfaces.extensions.validator.core.metadata.extractor.DefaultComponentMetaDataExtractor.extract(DefaultComponentMetaDataExtractor.java:77)
>  at
> org.apache.myfaces.extensions.validator.core.interceptor.AbstractValidationInterceptor.getPropertyInformation(AbstractValidationInterceptor.java:176)
>  at
> org.apache.myfaces.extensions.validator.core.interceptor.AbstractValidationInterceptor.processAfterValidation(AbstractValidationInterceptor.java:166)
>  at
> org.apache.myfaces.extensions.validator.core.interceptor.AbstractValidationInterceptor.beforeGetConvertedValue(AbstractValidationInterceptor.java:153)
>  at
> org.apache.myfaces.extensions.validator.core.renderkit.ExtValRendererWrapper.getConvertedValue(ExtValRendererWrapper.java:369)
>  at javax.faces.component.UIInput.getConvertedValue(UIInput.java:1008) at 
> javax.faces.component.UIInput.validate(UIInput.java:934) at 
> javax.faces.component.UIInput.executeValidate(UIInput.java:1189) at 
> javax.faces.component.UIInput.processValidators(UIInput.java:691) at
> javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1080)
>  at
> javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1080)
>  at javax.faces.component.UIForm.processValidators(UIForm.java:243) at
> javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1080)
>  at
> javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1080)
>  at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:1180) 
> at
> com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76)
>  at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at 
> com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) at 
> javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
> I used the following code:
> ===
> Page:
> ===
> <ui:composition template="/resources/templates/test-template.xhtml">
> <ui:define name="test-workspace">
> <ui:remove> a) works <parts-test:nestedCC myValue="#{personBean.person}"/> b) 
> works <parts-test:nestedCC
> myValue="#{personBean.person.adresse}"/> </ui:remove>
> c) NPE!!! <parts-test:nestedCC myValue="#{personBean.person.adresse.plz}"/>
> </ui:define>
> </ui:composition>
> ===
> CustomComponent:
> ===
> <composite:interface> <composite:attribute name="myValue" required="true" /> 
> </composite:interface>
> <composite:implementation>
> <ui:remove> a) works <h:inputText id="theValue" 
> value="#{cc.attrs.myValue.adresse.plz}"
> /> b) works <h:inputText id="theValue"
> value="#{cc.attrs.myValue.plz}" /> </ui:remove>
> c) NPE!!! <h:inputText id="theValue" value="#{cc.attrs.myValue}" />
> </composite:implementation>
> The code behind the scenes is: - a managed bean "PersonBean" - ...which 
> refers to an object "Person" which refers to an object "Adresse"
> which has a string property "plz" - for testing purposes I implemented some 
> get/setPlz in PersonBean and Person
> too which provide the value stored in Adresse.plz
> In case c), using a deeply nested EL expression, the NPE occurs.
> In the ExtVal code I found in
> org.apache.myfaces.extensions.validator.core.el.DefaultELHelper.getPropertyDetailsOfValueBinding(UIComponent):
> @ToDo(value = Priority.HIGH, description = "check if it works with nested
> composite components")
> Is this TODO still an open one or is the EL expression revealing a new bug?

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

Reply via email to