webtier@glassfish.java.net

Re: JSF 2.0 composite components with method-valued attributes

From: <webtier_at_javadesktop.org>
Date: Sun, 15 Mar 2009 15:34:33 PDT

Finally I decided to try the current version (it would work in future anyway).
To be honest, first I tried a version built from svn sources but ran into a problem
with method value expressions, then I tried Mar 13 nightly and found that .parent returned the direct parent component not necessary the composite one (for instance h:panelGroup) - I do not think this is worth mentioning in detail because it seems fixed. Then I found theres Mar 15 nightly and tried that one. Parent works fine, but I still have problems with method expressions, I guess something simple broke, here are the details, I'll try to investigate further..

the exception:
javax.faces.el.EvaluationException: javax.el.PropertyNotFoundException: /resources/navbutton/nav.xhtml @57,122 action="#{compositeComponent.attrs.navigation.goNav}": The class 'ezcomp.NavigationHandler' does not have the property 'goNav'.
        at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:95)
        at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
        at javax.faces.component.UICommand.broadcast(UICommand.java:387)
        at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:795)
        at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1279)
        at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:102)
        at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:310)
        at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:427)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:315)
        at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:287)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:218)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
        at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:222)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:166)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
        at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:288)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:647)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:579)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:831)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
        at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
        at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
Caused by: javax.el.PropertyNotFoundException: /resources/navbutton/nav0.xhtml @64,122 action="#{compositeComponent.attrs.navigation.goNav}": The class 'ezcomp.NavigationHandler' does not have the property 'goNav'.
        at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:110)
        at com.sun.faces.facelets.tag.TagAttributeImpl$AttributeLookupMethodExpression.invoke(TagAttributeImpl.java:251)
        at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)


to reproduce it change nav sample to:
basic-ezcomp/nav0.xhtml

<h:form>
         <ez:nav label="LABEL" navigation="#{navigation}" />
</h:form>

and basic-ezcomp/resources/navbutton/nav.xhtml to
<composite:interface>
   <composite:attribute name="navigation" />
</composite:interface>

<composite:implementation>
<h:commandButton id="navbutton" action="#{compositeComponent.attrs.navigation.goNav}" value="NavButton" type="submit" />

</composite:implementation>
[Message sent by forum member 'nzinoviev' (nzinoviev)]

http://forums.java.net/jive/thread.jspa?messageID=337078