Bonjour chers membres,
je suis en developpement Java EE et j'ai une exception de type java.lang.NullPointerException dons voici:
je constate que la methode getAllmodel() due l'implementation du DAO n'est pas executée.
Code : Sélectionner tout - Visualiser dans une fenêtre à part 
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
voici la methode:le bean est:
Code : Sélectionner tout - Visualiser dans une fenêtre à part 
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
86
87
Code : Sélectionner tout - Visualiser dans une fenêtre à part 
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
enfin la page jsf
Code : Sélectionner tout - Visualiser dans une fenêtre à part 
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
j'ai deux interfaces,interface DOA et interface service Service que voici<!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:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
<ui:composition template="/Views/Template/common.xhtml">
<ui:define name="Edition">
</ui:define>
<ui:define name="Consultation">
<p:dialog header="Ajout d'un model" widgetVar="modelAjout" resizable="true" id="editM" >
<p:growl id="growl" showDetail="true" sticky="false" />
<h:panelGrid id="display" columns="2" cellpadding="4" style="margin:0 auto;">
<f:facet name="header">
<h:outputLabel value="bonjour"/>
</f:facet>
<h:outputLabel for="id" title="id" value="id:" style="color: crimson;" />
<h:inputText value="#{modelBean.model.idModel}" id="id" required="true" visible="false"/>
<h:outputLabel for="marque" value="Marque:" style="color: crimson;"/>
<h:inputText value="#{modelBean.model.marque}" id="marque" required="true"/>
<h:outputLabel for="type" title="type" value="Type:" style="color: crimson;"/>
<h:inputText value="#{modelBean.model.type}" id="type" required="true"/>
</h:panelGrid>
<p:separator/>
<p:commandButton value="Enregistrer" action="#{modelBean.addModel}" />
</p:dialog>
<h:form id="tbb">
<p:outputPanel>
<h:outputText value="Search:" style="Height:30px"/>
<p:inputText id="globalFilter" onkeyup="TypeCarburant.filter()" style="width:150px" />
</p:outputPanel>
<h:form id="AjoutM">
<p:commandButton value="Ajouter un model Vehicule" icon="ui-icon-adds" onclick="modelAjout.show()"/>
</h:form>
<p:dataTable id="dataTable" var="model" value="#{modelBean.allmodel}" sortMode="single" rows="5" paginator="true" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="5,15,25">
<p:column sortBy="#{model.idModel}" headerText="ID" >
<h:outputText value="#{model.idModel}" />
</p:column>
<p:column sortBy="#{model.marque}" headerText="Marque">
<h:outputText value="#{model.marque}" />
</p:column>
<p:column sortBy="#{model.type}" headerText="Model:">
<h:outputText value="#{model.type}" />
</p:column>
</p:dataTable>
</h:form>
</ui:define>
</ui:composition>
</html>
je ne comprends pas ou est que j'ai mal instancié un objet,est ce que quequ'un remarque quelque chose dans ce code?
Code : Sélectionner tout - Visualiser dans une fenêtre à part 
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

 

 
		
		 
         
 

 
			
			


 
 


 Erreur "java.lang.NullPointerException" avec JSF
 Erreur "java.lang.NullPointerException" avec JSF
				 Répondre avec citation
  Répondre avec citation

 
  
  
 
 
			 
   
				 
						

 
    Envoyé par cryo94
 Envoyé par cryo94
					

 
						
Partager