Bonjour,
j'essaye d’implémenter une couche de présentation avec JSF en utilisant la librairie PrimeFaces, mais quand j'execute l'appli , j'ai l'erreur suivante.voici le code de ma page listeproduits
Code : Sélectionner tout - Visualiser dans une fenêtre à part 10:30:48,746 SEVERE [javax.enterprise.resource.webcontainer.jsf.application] Error Rendering View[/pages/accueil.xhtml]: javax.el.PropertyNotFoundException: /pages/accueil.xhtml @12,65 value="#{produitBean.listeProduits}": The class 'com.bean.ProduitBean' does not have the property 'listeProduits'.et dans mon bean j'ai bien mis les getters et les setters.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 <p:dataTable var="produit" value="#{produitBean.listeProduits}"> <p:column> <f:facet name="header"> Model </f:facet> <h:outputText value="#{produit.nom}" /> </p:column> <p:column> <f:facet name="header"> Year </f:facet> <h:outputText value="#{produit}" /> </p:column> </p:dataTable>
merci de votre aide.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40 public class ProduitBean implements Serializable { private List<Produit> listeProduits; private InitialContext ctx; public ProduitBean(){ environment = new Properties(); environment.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); environment.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces"); environment.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099"); // remote machine IP this.populateBean(); } public void populateBean(){ try { ctx = new InitialContext(environment); test=(GetDataFromDBRemote) ctx.lookup("Projet/GetDataFromDB/remote-com.session.dao.GetDataFromDBRemote"); if(test!=null){ listeProduits=test.getListProduits(); } } catch (NamingException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public List<Produit> getListeProduits() { return listeProduits; } public void setListeProduits(List<Produit> listeProduits) { this.listeProduits = listeProduits; } }







Répondre avec citation
Partager