Salut
j'ai une liste déroulante que je veux la remplir via une base de donnée oracle(noté que je travaille avec jsf 2.0 sous netbeans)
mais un message d'erreur s'affiche:
Code :
- An Error Occurred:
- Cannot convert [javax.faces.model.SelectItem@61d27a] of type class java.util.ArrayList to class javax.faces.model.SelectItem
- java.lang.IllegalArgumentException: Cannot convert [javax.faces.model.SelectItem@61d27a] of type class java.util.ArrayList to class javax.faces.model.SelectItem
- at com.sun.el.lang.ELSupport.coerceToType(ELSupport.java:397)
- at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:222)
- at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:190)
- at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:178)
- at javax.faces.component.UISelectItem.getValue(UISelectItem.java:231)
- at com.sun.faces.renderkit.SelectItemsIterator.initializeItems(SelectItemsIterator.java:189)
- at com.sun.faces.renderkit.SelectItemsIterator.hasNext(SelectItemsIterator.java:135)
- at com.sun.faces.renderkit.html_basic.MenuRenderer.renderOptions(MenuRenderer.java:760)
- at com.sun.faces.renderkit.html_basic.MenuRenderer.renderSelect(MenuRenderer.java:842)
- at com.sun.faces.renderkit.html_basic.MenuRenderer.encodeEnd(MenuRenderer.java:296)
- at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:878)
- at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1620)
- at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1616)
- at com.sun.faces.application.view.JspViewHandlingStrategy.doRenderView(JspViewHandlingStrategy.java:420)
- at com.sun.faces.application.view.JspViewHandlingStrategy.renderView(JspViewHandlingStrategy.java:209)
- at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:126)
- at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:127)
- at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
- at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
- at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
- at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
- at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
- at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
- at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
- at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
- at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
- at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
- at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:332)
- at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:233)
- at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
- at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
- at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
- at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
- at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
- at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
- at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
- at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
- at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
- at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
- at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
- at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
- at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
- at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
- at java.lang.Thread.run(Thread.java:619)
|
voici mon bean:
------------------------------
et dans ma page jsf
j'ai mis
Code :
- <h:selectOneMenu value=" # {Monbean.maValeur}" >
- <f:selectItem value="#{Monbean .mesElements}"/>
|
Pourriez vous s'il vous plait m'aider à corriger mon code source
je vous remercie