Bonjour, je sui debutant en struts et je narrive po a regler un problem depui klk jours
En fait je ve lister une table de clients dan une page jsp, mai je rencontre tjrs un problem de type :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2message No action instance for path /viewClients could be
Je vous montre mon fichier 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
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 <?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd"> <struts-config> <form-beans> <form-bean name="agentForm" type="com.sat.struts.form.AgentForm" /> <form-bean name="vodForm" type="com.sat.struts.form.VodForm" /> <form-bean name="clientForm" type="com.sat.struts.form.ClientForm" /> </form-beans> <action-mappings> <action attribute="agentForm" name="agentForm" input="/form/home.jsp" path="/home" scope="request" type="com.sat.struts.action.SubmitAction"> <forward name="failure" path="/form/errorLogin.jsp" /> <forward name="success" path="/form/menu.jsp" /> </action> <action attribute="agentForm" name="agentForm" parameter="do" path="/viewUsers" scope="request" type="com.sat.struts.action.UsersListAction"> <forward name="showList" path="/form/usersList.jsp" /> <forward name="showListAfterDelete" path="/viewUsers.do?do=showUsers" /> </action> <action attribute="clientForm" name="clientForm" parameter="do" path="/viewClients" scope="request" type="com.sat.struts.action.ClientsListAction"> <forward name="showList" path="/form/clientsList.jsp" /> <forward name="showListAfterDelete" path="/viewClients.do?do=showClients" /> </action> <action path="/logout" type="com.sat.struts.action.LogoutAction"> <forward name="logout" path="/form/home.jsp" /> </action> <action attribute="vodForm" name="vodForm" parameter="do" path="/viewVods" input="/form/vod.jsp" scope="request" type="com.sat.struts.action.VodListAction"> <forward name="showList" path="/form/VodList.jsp" /> <forward name="showListAfterDelete" path="/viewVods.do?do=showVods" /> </action> </action-mappings> <message-resources parameter="com.sat.struts.ApplicationResources.properties"/> </struts-config>
Voici mon action :
et voici le code de ma page jsp
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 package com.sat.struts.action; import java.sql.SQLException; import java.util.Collection; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.apache.struts.actions.DispatchAction; import com.sat.metier.Agent; import com.sat.struts.form.ClientForm; public class ClientsListAction extends DispatchAction{ public ActionForward deleteClient( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws SQLException { //ClientForm clientForm = (ClientForm) form; String nom =request.getParameter("nom"); Agent user = new Agent(); user.deleteByNom(nom); return mapping.findForward("showListAfterDelete"); } public ActionForward showClients( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { ClientForm clientForm = (ClientForm) form; Agent user = new Agent(); Collection c; try { c = (Collection) user.Lister3(); System.out.println(c.toString()); clientForm.setClients(c); System.out.println("la collection est remplie"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } return mapping.findForward("showList"); }
SVP aidez moi
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 </style></head> <body> <table width="162" height="88" border="1" align="right"> <tr> <td width="152" height="82"><img src="/sat/form/images/logo_meditel.jpg" width="152" height="77"></td> </tr> </table> <p> </p> <p> </p> <table width="335" border="1" align="center"> <tr> <td width="325"><p class="Style1">LA LISTE DES CLIENTS EN TRAITEMENT </p> </td> </tr> </table> <p> </p> <table width="757" border="1"> <tr> <td class="Style1">CLIENT</td> <td class="Style1">ADRESSE</td> </tr> <logic:empty name="clientForm" property="clients"> <tr> <td colspan="5">Tous Les Clients Sont Servis</td> </tr> </logic:empty> <logic:notEmpty name="clientForm" property="clients"> <logic:iterate name="clientForm" property="clients" id="client"> <tr> <td width="325"><p class="Style1"><bean:write name="client" property="nom" /></td> <td width="325"><p class="Style1"><bean:write name="client" property="adresse" /></td> </logic:iterate> </logic:notEmpty> </table> <p> </p> <div align="center"><span class="Style4"><a href="/sat/form/menu.jsp" class="Style2">RETOUR AU MENU PRINCIPAL</a> </span></div> </body> </html>
merci davance
Partager