Salut !
Je suis en train de réaliser un projet avec le framework Struts.
Donc,en bref, j'ai une page inscription_candidat.jsp et une autre creer_cv.jsp.
Lors de la creation de compte je veux stocker les informations de compte dans bean(candidat) puis faire une redirection vers la page creer_cv.jsp pour créer le Cv du candidat et enfin sauvegarder les champs dans la BD.
J'aurais besoin d'aide... J'ai un problème que je n'arrive pas à résoudre.
voici l'erreur :
voici mes ressources:cause mère
javax.servlet.ServletException: BeanUtils.populate
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:475)
org.apache.struts.chain.commands.servlet.PopulateActionForm.populate(PopulateActionForm.java:50)
org.apache.struts.chain.commands.AbstractPopulateActionForm.execute(AbstractPopulateActionForm.java:60)
org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
cause mère
java.lang.IllegalArgumentException: argument type mismatch
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyUtils.java:1789)
org.apache.commons.beanutils.PropertyUtils.setNestedProperty(PropertyUtils.java:1684)
....
inscription_candidat.jsp
Candidat.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
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 <html:form action="/creer_cv"> <table align="center"> <tr> <td>Civilite</td> <td>Nom</td> <td>Prenom</td> </tr> <tr> <td><html:text property="civilite" name="candidat"/> </td> <td><html:text property="nomCnd" name="candidat" /></td> <td><html:text property="prenomCnd" name="candidat" /></td> </tr> <tr> <td>Date Naissance</td> <td>Ville</td> <td>Pays</td> </tr> <tr> <td><html:text property="dateNaissanceCnd" name="candidat" /></td> <td><html:text property="villeCnd" name="candidat" /></td> <td><html:text property="paysCnd" name="candidat" /></td> </tr> <tr> <td colspan="3">Adresse</td> </tr> <tr style="height: 37px;"> <td colspan="3"><html:textarea property="adresseCnd" name="candidat" style=" width : 484px;" /></td> </tr> <tr> <td>Tél Portable</td> <td>Tél Fixe</td> <td>Code Postale</td> </tr> <tr> <td><html:text property="telPortanleCnd" name="candidat" /></td> <td><html:text property="telFixeCnd" name="candidat" /></td> <td><html:text property="codePostale" name="candidat" /></td> </tr> <tr> <td colspan="3">Photo</td> </tr> <tr> <td colspan="3"><html:file property="photo" name="candidat" style=" width : 444px;" /></td> </tr> <tr> <td colspan="3">Identifiants ITrecrute</td> </tr> <tr> <td colspan="3"> <table> <tr> <td>E-mail</td> <td>Confirmation E-mail</td> </tr> <tr> <td><html:text property="emailCnd" name="candidat" /></td> <td><html:text property="emailCnd" /></td> </tr> <tr> <td>Mot de Passe</td> <td>Confirmation Mot de Passe</td> </tr> <tr> <td><html:text property="motPasseCnd" name="candidat" /></td> <td><html:text property="motPasseCnd" /></td> </tr> </table> </td> </tr> <tr> <td colspan="3" align="right"><html:submit value="Créer Mon Compte" /></td> </tr> </table> </html:form>
Civilite.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
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150 package modeles_candidat; // Generated 29 juil. 2010 14:21:09 by Hibernate Tools 3.2.2.GA import java.util.Date; import java.util.HashSet; import java.util.Set; import javax.servlet.http.HttpServletRequest; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionMapping; import modeles_generale.Civilite; import modeles_generale.Langue; import modeles_recruteur.Offre; /** * Candidat generated by hbm2java */ public class Candidat extends ActionForm implements java.io.Serializable { /** * */ private static final long serialVersionUID = 1L; private String nomCnd; private String prenomCnd; private Date dateNaissanceCnd; private String adresseCnd; private String telFixeCnd; private String telPortanleCnd; private String villeCnd; private String paysCnd; private String codePostale; private String emailCnd; private String motPasseCnd; private Civilite civilite; private String photo; public Candidat() { } public String getNomCnd() { return this.nomCnd; } public void setNomCnd(String nomCnd) { this.nomCnd = nomCnd; } public String getPrenomCnd() { return this.prenomCnd; } public void setPrenomCnd(String prenomCnd) { this.prenomCnd = prenomCnd; } public Date getDateNaissanceCnd() { return this.dateNaissanceCnd; } public void setDateNaissanceCnd(Date dateNaissanceCnd) { this.dateNaissanceCnd = dateNaissanceCnd; } public String getAdresseCnd() { return this.adresseCnd; } public void setAdresseCnd(String adresseCnd) { this.adresseCnd = adresseCnd; } public String getTelFixeCnd() { return this.telFixeCnd; } public void setTelFixeCnd(String telFixeCnd) { this.telFixeCnd = telFixeCnd; } public String getTelPortanleCnd() { return this.telPortanleCnd; } public void setTelPortanleCnd(String telPortanleCnd) { this.telPortanleCnd = telPortanleCnd; } public String getVilleCnd() { return this.villeCnd; } public void setVilleCnd(String villeCnd) { this.villeCnd = villeCnd; } public void setCodePostale(String codePostale) { this.codePostale = codePostale; } public String getCodePostale() { return codePostale; } public String getPaysCnd() { return this.paysCnd; } public void setPaysCnd(String paysCnd) { this.paysCnd = paysCnd; } public String getEmailCnd() { return this.emailCnd; } public void setEmailCnd(String emailCnd) { this.emailCnd = emailCnd; } public String getMotPasseCnd() { return this.motPasseCnd; } public void setMotPasseCnd(String motPasseCnd) { this.motPasseCnd = motPasseCnd; } public Civilite getCivilite() { return civilite; } public void setCivilite(Civilite civilite) { this.civilite = civilite; } public void setPhoto(String photo) { this.photo = photo; } public String getPhoto() { return photo; } }
struts-config.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
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40 package modeles_generale; // Generated 29 juil. 2010 14:31:12 by Hibernate Tools 3.2.2.GA /** * Civilite generated by hbm2java */ public class Civilite implements java.io.Serializable { /** * */ private static final long serialVersionUID = 1L; private int idCivilite; private String libelleCivilite; public Civilite() { } public Civilite(String libelleCivilite) { this.libelleCivilite = libelleCivilite; } public int getIdCivilite() { return this.idCivilite; } public void setIdCivilite(int idCivilite) { this.idCivilite = idCivilite; } public String getLibelleCivilite() { return this.libelleCivilite; } public void setLibelleCivilite(String libelleCivilite) { this.libelleCivilite = libelleCivilite; } }
Code xml : 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 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_3.dtd"> <struts-config> <data-sources/> <form-beans> <form-bean name="candidat" type="modeles_candidat.Candidat"/> <form-bean name="civilite" type="modeles_generale.Civilite"/> </form-beans> <global-exceptions/> <global-forwards/> <action-mappings> <action path="/inscription_candidat" parameter="/inscription_candidat.jsp" type="org.apache.struts.actions.ForwardAction"/> <action name="candidat" path="/creer_cv" scope="session" parameter="/creer_cv.jsp" type="org.apache.struts.actions.ForwardAction"/> </action-mappings> <controller/> </struts-config>
je crois que l'erreur vient soit du champs dateNaissanceCnd ou civilite
merci d'avance
Partager