Bonjour,
Mon but est d'afficher une table qui existe dans une base de données Oracle.
J'ai établis le code du ManagedBean et la page mais pourtant ça ne marche pas.
Voici le code :la page est la suivante :
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85 package com.controller; import java.util.ArrayList; import java.util.List; import org.hibernate.Session; import org.hibernate.Transaction; import com.dao.ContactDao; import com.dao.imp.ContactDaoImp; import com.model.Contact; import com.model.Utilisateur; import com.util.hibernateutil; public class ContactCtr { private String numPieceCnt; private String nomNomCnt; private String nomPreCnt; private String adrAdrCnt; private String numGsmCnt; private String codTpceCnt; private List<Contact> contact=new ArrayList(); ContactDao Cont= new ContactDaoImp(); public List<Contact> getContact() { if(contact==null){ contact = Cont.findallContact(); } return contact; } public void setContact(List<Contact> contact) { this.contact = contact; } public String getNumPieceCnt() { return this.numPieceCnt; } public void setNumPieceCnt(String numPieceCnt) { this.numPieceCnt = numPieceCnt; } public String getNomNomCnt() { return this.nomNomCnt; } public void setNomNomCnt(String nomNomCnt) { this.nomNomCnt = nomNomCnt; } public String getNomPreCnt() { return this.nomPreCnt; } public void setNomPreCnt(String nomPreCnt) { this.nomPreCnt = nomPreCnt; } public String getAdrAdrCnt() { return this.adrAdrCnt; } public void setAdrAdrCnt(String adrAdrCnt) { this.adrAdrCnt = adrAdrCnt; } public String getNumGsmCnt() { return this.numGsmCnt; } public void setNumGsmCnt(String numGsmCnt) { this.numGsmCnt = numGsmCnt; } public String getCodTpceCnt() { return this.codTpceCnt; } public void setCodTpceCnt(String codTpceCnt) { this.codTpceCnt = codTpceCnt; } }
Quelqu'un saurait-il me dire d'où pourrait venir le problème ?
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich"> <head> <title>Gestion</title> </head> <body> <ui:decorate template="../template/template.xhtml"> <ui:define name="body"> <h:form > <f:view> <div align="center"> <rich:dataTable border="1" rules="all" value="#{Con.contact}" var="p"> <h:column> <f:facet name="header"> <h:outputText value="NumeroPiece" /> </f:facet> <h:outputText value="#{p.numPieceCnt}" /> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Prénom" /> </f:facet> <h:outputText value="#{p.nomPreCnt}" /> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Nom" /> </f:facet> <h:outputText value="#{p.nomNomCnt}" /> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Adresse" /> </f:facet> <h:outputText value="#{p.adrAdrCnt}" /> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Gsm" /> </f:facet> <h:outputText value="#{p.numGsmCnt}" /> </h:column> <h:column> <f:facet name="header"> <h:outputText value="TypePiece" /> </f:facet> <h:outputText value="#{p.codTpceCnt}" /> </h:column> </rich:dataTable> </div> </f:view> </h:form> </ui:define> </ui:decorate> </body> </html>
Merci d'avance pour votre aide.
Partager