Bonjour!
Bon voilà je me casse les dents depuis une journée...sur un problème de Dipatach Action... ce qui m'énerve le plus c'est que le programme fait déjà appel au DispatchAction sans aucun problème!!!
mon jsp:
le struts-config
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312 <%@page contentType="text/html"%> <%@page pageEncoding="UTF-8"%> <%@ page language="java" %> <%@taglib uri="http://struts.apache.org/tags-html" prefix="html" %> <%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> <%@taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> <html:html> <head> <STYLE TYPE="text/css"> @import url(./style.css); </STYLE> <script language="JavaScript"> function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6. { var arVersion = navigator.appVersion.split("MSIE") var version = parseFloat(arVersion[1]) if ((version >= 5.5) && (document.body.filters)) { for(var i=0; i<document.images.length; i++) { var img = document.images[i] var imgName = img.src.toUpperCase() if (imgName.substring(imgName.length-3, imgName.length) == "PNG") { var imgID = (img.id) ? "id='" + img.id + "' " : "" var imgClass = (img.className) ? "class='" + img.className + "' " : "" var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' " var imgStyle = "display:inline-block;" + img.style.cssText if (img.align == "left") imgStyle = "float:left;" + imgStyle if (img.align == "right") imgStyle = "float:right;" + imgStyle if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle var strNewHTML = "<span " + imgID + imgClass + imgTitle + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";" + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" img.outerHTML = strNewHTML i = i-1 } } } } window.attachEvent("onload", correctPNG); </script> <script language="JavaScript"> function setHiddenCo(value){document.consultation.hidden.value=value;} function setHiddenAl(value){document.allergie.hidden.value=value;} function setHiddenAn(value){document.antecedent.hidden.value=value;} function setHiddenTr(value){document.traitement.hidden.value=value;} function setHiddenDi(value){document.divers.hidden.value=value;} </script> </head> <body> <div class="bordure"> <IMG src="images/ban.png"> <ul id="menu"> <li><a href="./emploitps.jsp">Emplois du temps</a></li> <li><a href="./search.jsp"><b>Recherche</b></a></li> <li><a href="./stat.html">Statistiques</a></li> </ul> <IMG width="100%" height=5 src="images/sep.png"> <p></p> <p></p> <table border=0 width="100%" > <tr> <td width="18%"> <table border=0 bgcolor="#FFFFFF" width="100%" > <tr> <td> <table border=0 bgcolor="#FFFFFF" width="100%"> <tr> <td align="right" valign="middle" width="50%"><bean:write name="select" property="choix" /> <h2>Jean Claude</h2> </td> <td align="left" valign="middle" width="50%"><h2> Duce </h2></td> </tr> <tr> <td align="right" colspan=2 valign="middle" width="100%"> <input type='submit' value='Autre Patient'></td> </tr> </table> </td> </tr> </table> <br> <table border=0 bgcolor="#FFFFFF" > <tr> <td align="left" valign="middle" width="30%"> <h2>Consultations</h2><html:form action="consultation"> <html:hidden property="hidden" value="bordel"/> </td> </tr> <tr> <td align="right" colspan=2 valign="middle" width="70%"> <html:submit styleId="button" property="sujet" onclick="setHiddenCo('add');" value="Ajouter Consultation">Ajouter Consultation</html:submit> </td> </tr> <tr> <td> <br> </td> </tr> <tr> <td> <table border=0 bgcolor="#FFFFFF" align="left"> <tr> <logic:present name="consultationlist"> <logic:iterate name="consultationlist" id="co"> <td width=80% ><html:submit property="co" onclick="setHiddenCo('see');" value="${co}" /></td> </logic:iterate> </logic:present> </tr> </table> </td> </tr> </table></html:form> <table border=0 bgcolor="#FFFFFF" > <tr> <td width="70%"> <table border=0 bgcolor="#FFFFFF" align="left"> <tr> <td colspan=2 align="left" valign="middle" width="30%"> <h2>Données Médicales</h2> </td> </tr> <tr> <td align="center" valign="top" width="35%"> <h2>Allergies</h2> </td> <td align="left" valign="middle" width="65%"> <table border=0 bgcolor="#FFFFFF" align="left"> <tr> <html:form action="allergie"> <html:hidden property="hidden" value="default"/> <logic:present name="allergielist"> <logic:iterate name="allergielist" id="al"> <td><%=al%></td><td><html:submit styleId="button" property="al" onclick="setHiddenAl('delete');" value="${al}" /></td> </tr> <tr> </logic:iterate> </logic:present> <td><html:text property="al" /></td> <td><html:submit onclick="setHiddenAl('add');">Ajouter</html:submit></html:form></td> </tr> <tr> <td> <br> </td> </tr> </table> </td> </tr> <tr> <td align="right" valign="top" width="35%"> <h2>Antécédents</h2> </td> <td align="left" valign="middle" width="65%"> <table border=0 bgcolor="#FFFFFF" align="left"> <tr> <html:form action="antecedent"> <html:hidden property="hidden" value="default"/> <logic:present name="antecedentlist"> <logic:iterate name="antecedentlist" id="an"> <td><%=an%></td><td><html:submit styleId="button" property="an" onclick="setHiddenAn('delete');" value="${an}" /></td> </tr> <tr> </logic:iterate> </logic:present> <td><html:text property="an" /></td> <td><html:submit onclick="setHiddenAn('add');">Ajouter</html:submit></html:form></td> </tr> <tr> <td> <br> </td> </tr> </table> </td> </tr> <tr> <td align="right" valign="top" width="35%"> <h2>Traitements de fonds</h2> </td> <td align="left" valign="middle" width="65%"> <table border=0 bgcolor="#FFFFFF" align="left"> <tr> <html:form action="traitement"> <html:hidden property="hidden" value="default"/> <logic:present name="traitementlist"> <logic:iterate name="traitementlist" id="tr"> <td><%=tr%></td><td><html:submit styleId="button" property="tr" onclick="setHiddenTr('delete');" value="${tr}" /></td> </tr> <tr> </logic:iterate> </logic:present> <td><html:text property="tr" /></td> <td><html:submit onclick="setHiddenTr('add');">Ajouter</html:submit></html:form></td> </tr> <tr> <td> <br> </td> </tr> </table> </td> </tr> <tr> <td align="right" valign="top" width="35%"> <h2>Divers</h2> </td> <td align="left" valign="middle" width="65%"> <table border=0 bgcolor="#FFFFFF" align="left"> <tr> <html:form action="divers"> <html:hidden property="hidden" value="default"/> <logic:present name="diverslist"> <logic:iterate name="diverslist" id="di"> <td><%=di%></td><td><html:submit styleId="button" property="di" onclick="setHiddenDi('delete');" value="${di}" /></td> </tr> <tr> </logic:iterate> </logic:present> <td><html:text property="di" /></td> <td><html:submit onclick="setHiddenDi('add');">Ajouter</html:submit></html:form></td> </tr> <tr> <td> <br> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table> <br> <table border=0 bgcolor="#FFFFFF" > <tr> <td align="left" valign="middle" width="30%"> <h2>Consultations</h2><html:form action="consultation"> <html:hidden property="hidden" value="bordel"/> </td> </tr> <tr> <td align="right" colspan=2 valign="middle" width="70%"> <html:submit styleId="button" property="sujet" onclick="setHiddenCo('add');" value="Ajouter Consultation">Ajouter Consultation</html:submit> </td> </tr> <tr> <td> <br> </td> </tr> <tr> <td> <table border=0 bgcolor="#FFFFFF" align="left"> <tr> <logic:present name="consultationlist"> <logic:iterate name="consultationlist" id="co"> <td width=80% ><html:submit property="co" onclick="setHiddenCo('see');" value="${co}" /></td> </logic:iterate> </logic:present> </tr> </table> </td> </tr> </table></html:form> ...etc
la Consultation
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 <struts-config> <form-beans> <form-bean name="allergie" type="camedel.AllergieFormulaire" /> <form-bean name="antecedent" type="camedel.AntecedentFormulaire" /> <form-bean name="traitement" type="camedel.TraitementFormulaire" /> <form-bean name="divers" type="camedel.DiversFormulaire" /> <form-bean name="consultation" type="camedel.ConsultationFormulaire" /> </form-beans> <global-exceptions> </global-exceptions> <global-forwards> </global-forwards> <action-mappings> <action path="/identification" type="camedel.Identification" name="id"> <forward name="succes" path="/search.jsp"/> <forward name="echec" path="/index.jsp"/> </action> <action path="/search" type="camedel.Search" name="search"> <forward name="succes" path="/search.jsp"/> </action> <action path="/select" type="camedel.SelectPatient" name="select"> <forward name="echec" path="/search.jsp"/> <forward name="succes" path="/main.jsp"/> </action> <action path="/allergie" type="camedel.Allergie" name="allergie" scope="request" validate="true" parameter="hidden"> <forward name="echec" path="/search.jsp"/> <forward name="succes" path="/main.jsp"/> </action> <action path="/antecedent" type="camedel.Antecedent" name="antecedent" scope="request" validate="true" parameter="hidden"> <forward name="echec" path="/search.jsp"/> <forward name="succes" path="/main.jsp"/> </action> <action path="/divers" type="camedel.Divers" name="divers" scope="request" validate="true" parameter="hidden"> <forward name="echec" path="/search.jsp"/> <forward name="succes" path="/main.jsp"/> </action> <action path="/traitement" type="camedel.Traitement" name="traitement" scope="request" validate="true" parameter="hidden"> <forward name="echec" path="/search.jsp"/> <forward name="succes" path="/main.jsp"/> </action> <action path="/consultation" type="camedel.Consultation" name="consultation" scope="request" validate="true" parameter="hidden"> <forward name="echec" path="/search.jsp"/> <forward name="succes" path="/main.jsp"/> </action> </struts-config>
et la consultation form
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 /* * Consultation.java * * Created on 12 décembre 2006, 17:58 * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package camedel; import org.apache.struts.actions.DispatchAction; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import java.lang.*; import java.util.*; import org.apache.struts.Globals; /** * * @author Feez */ public class Consultation extends DispatchAction { public ActionForward add(ActionMapping mapping, ActionForm form, HttpServletRequest request,HttpServletResponse response)throws IOException, ServletException { String cible = "succes"; List<String> list= new ArrayList<String>(); if(form!=null){ ConsultationFormulaire consultation = ( ConsultationFormulaire)form; HttpSession session=request.getSession(); session.setAttribute("prescriptionlist",null); list=(ArrayList<String>)session.getAttribute("consulationlist"); //consultation.setSujet(""); } return(mapping.findForward(cible)); } public ActionForward see(ActionMapping mapping, ActionForm form, HttpServletRequest request,HttpServletResponse response)throws IOException, ServletException { String cible = "succes"; List<String> list= new ArrayList<String>(); ConsultationFormulaire consultation = (ConsultationFormulaire)form; if(form!=null){ HttpSession session=request.getSession(); session.setAttribute("sujet",consultation.getSujet()); session.setAttribute("date",consultation.getDate()); list.add("doliprane"); session.setAttribute("prescriptionlist",list); } return(mapping.findForward(cible)); } public ActionForward addPr(ActionMapping mapping, ActionForm form, HttpServletRequest request,HttpServletResponse response)throws IOException, ServletException { String cible = "succes"; List<String> list= new ArrayList<String>(); List<String> list2= new ArrayList<String>(); List<String> list3= new ArrayList<String>(); if(form!=null){ ConsultationFormulaire consultation = (ConsultationFormulaire)form; HttpSession session=request.getSession(); list2=(ArrayList<String>)session.getAttribute("prescriptionlist"); if(list2!=null) list=(ArrayList<String>)session.getAttribute("prescriptionlist"); /* if(session.getAttribute("sujet").equals(consultation.getSujet())==false){ session.setAttribute("sujet",consultation.getSujet()); } if(session.getAttribute("date").equals(consultation.getDate())==false){ session.setAttribute("date",consultation.getDate()); }*/ if(consultation.getPr().equals("")==false && consultation.getPr().equals("Submit")==false ){ list.add(consultation.getPr()); session.setAttribute("prescriptionlist",list);} consultation.setPr(""); if( consultation.getSujet()!=null) consultation.setSujet((String)session.getAttribute("sujet")); if( consultation.getDate()!=null) consultation.setDate((String)session.getAttribute("date")); } return(mapping.findForward(cible)); } public ActionForward deletePr(ActionMapping mapping, ActionForm form, HttpServletRequest request,HttpServletResponse response)throws IOException, ServletException { String cible = "succes"; List<String> list= new ArrayList<String>(); if(form!=null){ ConsultationFormulaire consultation = (ConsultationFormulaire)form; HttpSession session=request.getSession(); list=(ArrayList<String>)session.getAttribute("prescriptionlist"); list.remove(consultation.getPr()); session.setAttribute("prescriptionlist",list); consultation.setPr(""); if( consultation.getSujet()!=null) consultation.setSujet((String)session.getAttribute("sujet")); if(consultation.getDate()!=null) consultation.setDate((String)session.getAttribute("date")); } return(mapping.findForward(cible)); } }
et voici l'erreur que j'obtiens: Action[/consultation] does not contain specified method (check logs)...
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 package camedel; import javax.servlet.http.HttpServletRequest; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionMapping; import java.lang.*; import java.util.*; import java.io.IOException; import java.io.UnsupportedEncodingException; public class ConsultationFormulaire extends ActionForm { private String date; private String sujet; private String co; private String tmp[]; private String pr; public void consultationformulaire(String date, String sujet) { this.date = date; this.sujet = sujet; } public void setCo(String co) { List<String> list= new ArrayList<String>(); tmp=co.split(" - "); this.date = tmp[0]; this.sujet = tmp[1]; } public String getCo(){ return null; } public String getDate() { return date; } public void setSujet(String sujet) { if(sujet.equals("Ajouter Consultation")==false) this.sujet = sujet; } public String getSujet() { return sujet; } public void setDate(String date) { this.date = date; } public void setPr(String pr) { this.pr=pr; } public String getPr() { return pr; } }
Je fais pourtant de meme avec Antecedent, Traitement, allergie... sans soucis! J'ai refait 50x des copié/collé pour m'assurrer que c'était exactement la même chose...là je suis à bout!
Si quelqu'un me trouve la soluce, j'crois que ca serait formidable
Bonne fête à tous,
++
Partager