Bonjour,
je suis débutante en java ,au moment de l’exécution de mon projet ,il m'affiche pas les bouton et les zone de texte sauf les labels qui s'affiche.
je ne sais pas le problème vient d'ou!
Aidez moi s'il vous plait.
Merci d'avance.
mon fichier web.xml
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
<?xml version="1.0" encoding="UTF-8"?>
 <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
 
  <display-name>DemoJSFJPA2</display-name>
  <welcome-file-list>
    <welcome-file>faces/ajouter.xhtml</welcome-file>
  </welcome-file-list>
  <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
  </servlet-mapping>
</web-app>
Ma classe Client.java
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
package com.iset.entities;
 
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
 
 
 
@Entity
public class Client implements Serializable{
 
		private static final long serialVersionUID = 1L;
 
 @Id 
@GeneratedValue (strategy=GenerationType.IDENTITY) 
//pour autoincrement 
 private int code;
 private String nom;
 private String ville;
public int getCode() {
	return code;
}
public void setCode(int code) {
	this.code = code;
}
public String getNom() {
	return nom;
}
public void setNom(String nom) {
	this.nom = nom;
}
public String getVille() {
	return ville;
}
public void setVille(String ville) {
	this.ville = ville;
}
 
public String toString() {
	return this.code + " "+this.nom+" "+this.ville;
 
}
 }
Mon faces-config.xml :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
<?xml version="1.0" encoding="UTF-8"?>
<faces-config
    xmlns="http://xmlns.jcp.org/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"
    version="2.2">
 
</faces-config>
La page ajouter.xhtml :
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
<?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:f="http://java.sun.com/jsf/core"      
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui">
 
<f:metadata>
 
</f:metadata>
 
<h:body>
	<h3>Ajout des clients</h3>
	<h:form>
	<h:panelGrid columns="2" cellpadding="5">
	    <h:outputLabel for="nom" value="Nom :" />
		<h:inputText id="nom" value="#{clientMB.client.nom}"></h:inputText>
 
		<h:outputLabel for="ville" value="Ville :" />
		<h:inputText id="ville" value="#{clientMB.client.ville}"></h:inputText>
 
		<h:commandButton value="Ajouter" action="#{clientMB.add}"></h:commandButton>
 
	</h:panelGrid>
	</h:form>
 
		<h1>Liste des clients</h1>
 
    		<h:dataTable value="#{clientMB.listeClients}" var="clt" >
    			<h:column>
    				<!-- column header -->
    				<f:facet name="header">Code</f:facet>
    				<!-- row record -->
    				<h:outputText value="#{clt.code}" />
    			</h:column>
 
    			<h:column>
    				<f:facet name="header">Nom</f:facet>
    				<h:outputText value="#{clt.nom}" />
    			</h:column>
 
    			<h:column>
    				<f:facet name="header">Ville</f:facet>
    				<h:outputText value="#{clt.ville}" />
    			</h:column>
 
 
 
 
 
 
    		</h:dataTable>
 
</h:body>
 
 
</html>