j'ai commencé par ajouter un id dans ma jsp comme suite
et le traitement dans mon action :
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 <logic:iterate id="toto" name="listdn" scope="session"> <tr> <TD align="center"><bean:write name="toto" property="prenom" /></TD> <TD align="center"><bean:write name="toto" property="nom" /></TD> <TD align="center"><bean:write name="toto" property="adresse" /></TD> <TD align="center"><bean:write name="toto" property="dateNaissance" /></TD> <TD align="center"><bean:write name="toto" property="telephone" /></TD> <TD><html:link page="/modPersonneForm.do" property='<bean:write name="toto" property="id" />'>Modifie</html:link> </DIV> </tr> </logic:iterate> </TABLE>
mais quand je veux modifier il m'ajoute un autre enregistrement.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 if (formulaire.getId() == resultSet.getInt("ID_Personne")) { String requete2 = "UPDATE personne SET nom ='" + formulaire.getNom() + "' prenom ='" + formulaire.getPrenom() + "'date_naissance ='" + formulaire.getDateNaissance() + "'adresse ='" + formulaire.getAdresse() + "'telephone ='" + formulaire.getTelephone() +"'"; instruction.executeUpdate(requete2); }![]()
Partager