bonsoir
je ss débutante dans struts et je voulais faire un tit exemple mais ça marche pasj'aurai tjr la meme erreur 404 la page n'est pas disponible !
est ce que qlq'un a une idée ??![]()
bonsoir
je ss débutante dans struts et je voulais faire un tit exemple mais ça marche pasj'aurai tjr la meme erreur 404 la page n'est pas disponible !
est ce que qlq'un a une idée ??![]()
Si tu veux de l'aide, il va falloir montrer un peu de code (web.xml, struts-config.xml, jsp, Action, ...).
Peux-tu aussi préciser la version de Struts que tu utilises ?
voila le web.xml
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
21
22
23
24 <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app> <servlet> <servlet-name>action</servlet-name> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class> <init-param> <param-name>config</param-name> <param-value>/WEB-INF/struts-config.xml</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>action</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping> <taglib> <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri> <taglib-location>/WEB-INF/struts-bean.tld</taglib-location> </taglib> </web-app>
le struts-config.xml
sachant que j'ai appliqué a la lettre un exemple paru ds un tutoriel !
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
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44 <?xml version="1.0" encoding="UTF-8"?> <!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="frmPersonne" type="controleur.formulaireBean" /> </form-beans> <action-mappings> <action path="index" name="frmPersonne" scope="session" validate="true" input="/erreurs.do" parameter="/vues/index.html" type="controleur.formulaireAction"> <forward name="reponse" path="/reponse.do"/> </action> <action path="/erreurs" parameter="/vues/erreurs.jsp" type="org.apache.struts.actions.ForwardAction" /> <action path="/reponse" parameter="/vues/reponse.jsp" type="org.apache.struts.actions.ForwardAction" /> <action path="/formulaire" parameter="/vues/formulaire.jsp" type="org.apache.struts.actions.ForwardAction" /> </action-mappings> </struts-config>
Ajoute un "/" dans l'attribut path ici :
Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 <action path="/index" name="frmPersonne" scope="session" validate="true" input="/erreurs.do" parameter="/vues/index.html" type="controleur.formulaireAction"> <forward name="reponse" path="/reponse.do"/> </action>
j'ai tjr la mme erreur, qd je remplis le formulaire et je clique sur envoyer je reçois la mme page 404 index n'est pas disponible :s:s![]()
aucune idée !!?
Partager