Bonjour,
En fait je fais du struts et j'ai un formulaire dans une page celui ci permet d'ajouter des dossiers dans une base.
Y a un champs ou l'utlisateur entre le dossier et un bouton submit qui active l'action d'ajout du dossier.
Et ca marche ca ajoute le dossier..
voici le contenu du form de la page jsp:
Le problème c'est que lorsque l'utilisateur ajoute un dossier et qu'ensuite il réactualise cette meme page de formulaire ca réajoute le dossier..
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 <!-- Formulaire d'ajout d'un shift --> <html:form action="ShiftAjoutAction.do"> <tr> <td> <br> <small style="font-weight: bold;"><span style="font-family: Arial;"> <img style="width: 9px; height: 9px;"alt="" src="Images\untitled.bmp"> <bean:message key="Shift.ajouter"/></span></small> </td></tr> <tr><td> <span style="font-family: Arial;"><small><br> <bean:message key="Shift.ajoutMessage"/><br> </small></span> <html:errors property="auteurShift"/> <html:errors property="contenuShift"/> <!--tabel de presentation auteur date etc..--> <table style="text-align: left; " border="0" cellpadding="2" cellspacing="2"> <tbody> <tr> <td> <small style="font-weight: bold;"><span style="font-family: Arial;"> <bean:message key="Shift.auteur"/> </span></small> </td><td> <html:text property="auteurShift"></html:text> </td> </tr> <tr><td> <small style="font-weight: bold;"><span style="font-family: Arial;"> <bean:message key="Shift.contenu"/> <br></span></small></td><td> <html:textarea cols="40" rows="5" property="contenuShift"></html:textarea> </td> </tr> <tr> <td></td> <td><html:submit value="Add" style="width: 50px; height: 20px;"></html:submit> </td> </tr> </tbody> </table>
voici la partie de mon struts config qui correspond
lorsque le user clique sur le bouton ajouter ca va ici:
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 //lorsque j'ajoute un shift c'est cette action qui est activé <action path="/ShiftAjoutAction" type="fr.edition.eni.action.ShiftAjoutAction" name="shiftForm" scope="request" input="/LancerShiftSansAuthentification.do"> <forward name="success" path="/LancerShiftSansAuthentification.do"></forward> <forward name="erreur" path="/LancerAffichageShift.do"></forward> </action> <!--Action pour supprimer un shift de la base --> <action path="/ShiftSuppressionAction" type="fr.edition.eni.action.ShiftSuppressionAction" name="shiftFormSansValidation" scope="request" input="/LancerShiftSansAuthentification.do"> <forward name="success" path="/LancerShiftSansAuthentification.do"></forward> <forward name="erreur" path="/shiftForm.jsp"></forward> </action> <action path="/LancerShiftAction" type="fr.edition.eni.action.LancerShiftAction" name="acceuilForm" scope="request" input="/shiftForm.jsp"> <forward name="success" path="/afficheShift.jsp"></forward> <forward name="nonAutoriséAdmi" path="/accesNonAutorise.jsp"></forward> </action> <action path="/LancerAffichageShift" type="fr.edition.eni.action.LancerAffichageShift" name="acceuilForm" scope="request" input="/LancerShiftAction.do"> <forward name="success" path="/shiftForm.jsp"></forward> <forward name="nonAutoriséAdmi" path="/accesNonAutorise.jsp"></forward> </action> <!-- Action de lancement du formulaire des shifts sans effectuer d'authentification --> <action path="/LancerShiftSansAuthentification" type="fr.edition.eni.action.LancerShiftSansAuthentification" name="acceuilForm" scope="request" input="/LancerShiftAction.do"> <forward name="success" path="/shiftForm.jsp"></forward> </action>
http://localhost:8084/WebApplication...AjoutAction.do
c'est ca le probleme normalement ca devrait aller sur
http://localhost:8084/WebApplication...ntification.do
et du coup quant on réactualise ca va encore aller sur
http://localhost:8084/WebApplication...AjoutAction.do
et ajouter un shift donc ...
Je comprend pas pourquoi ca renvoie pas sur cette page:
http://localhost:8084/WebApplication...ntification.do
Partager