Home  >  Forum  >  JSF
Post New Query

javax.el.ELException: Cannot convert output of type class java.lang.String


joined on
January 20,2015
Asked on January 23,2015
Hi,

I am creating JSF composite component  demo application. Need help to resolve below exception.

javax.el.ELException: Cannot convert output of type class java.lang.String to class javax.el.MethodExpression
org.apache.el.lang.ELSupport.coerceToType(ELSupport.java:419)
org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
com.sun.faces.facelets.el.ContextualCompositeValueExpression.getValue(Unknown Source)
com.sun.faces.facelets.el.TagValueExpression.getValue(Unknown Source)
com.sun.faces.facelets.tag.TagAttributeImpl$AttributeLookupMethodExpression.invoke(Unknown Source)
javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(Unknown Source)
com.sun.faces.application.ActionListenerImpl.processAction(Unknown Source)
javax.faces.component.UICommand.broadcast(Unknown Source)
javax.faces.component.UIViewRoot.broadcastEvents(Unknown Source)
javax.faces.component.UIViewRoot.processApplication(Unknown Source)
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(Unknown Source)
com.sun.faces.lifecycle.Phase.doPhase(Unknown Source)
com.sun.faces.lifecycle.LifecycleImpl.execute(Unknown Source)
javax.faces.webapp.FacesServlet.service(Unknown Source)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
joined on
November 18,2013
Replied on January 23,2015

Please explain what are you creating.
joined on
January 20,2015
Replied on January 23,2015

I am creating a composite component in JSF and creating command button as below.

<composite:interface>
 --------------------
---------------------
 <composite:attribute name="submitButtonAction" />

</composite:interface>

<composite:implementation>
  
   -----------------------
   ----------------------
   <h:commandButton value="#{cc.attrs.submitButtonLabel}"  action="#{cc.attrs.submitButtonAction}"/>

</composite:implementation>

joined on
November 18,2013
Replied on January 23,2015

You have not defined <b>method-signature</b> in <composite:attribute name="submitButtonAction" />

define it as

<composite:attribute name="submitButtonAction" method-signature="java.lang.String anyMethod()" />
in         <composite:interface>

Write Answer









Copyright ©2017 concretepage.com, all rights reserved |Privacy Policy | Contact Us