Salut à tous.
Voilà je débute dans Struts et me voilà déjà confronter à des problèmes surement de config
Voilà mon struts-config.xml :
Mon web.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 <?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.3//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_3.dtd"> <struts-config> <form-beans> <form-bean name="ConfigAddElementForm" type="ot.form.ConfigAddElementBean" /> </form-beans> <action-mappings> <action path="/Main" parameter="/view/Main.jsp" type="org.apache.struts.actions.ForwardAction" /> <!-- DEBUT CONFIG ADD ELEMENT --> <action path="/ConfigAddElement" parameter="/view/ConfigAddElement.jsp" type="ot.action.ConfigAddElementAction" name="ConfigAddElemenForm" scope="request" > <forward name="ConfigAddElementError" path="/ConfigAddElementError.do"/> <forward name="ConfigAddElementSuccess" path="/ConfigAddElementSuccess.do"/> </action> <action path="/ConfigAddElementError" parameter="/view/ConfigAddElement.jsp?result=error" type="org.apache.struts.actions.ForwardAction"> </action> <action path="/ConfigAddElementSuccess" parameter="/view/ConfigAddElement.jsp?result=success" type="org.apache.struts.actions.ForwardAction"> </action> <!-- FIN CONFIG ADD ELEMENT --> </action-mappings> </struts-config>
Et enfin ma 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 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/j2ee/dtds/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> </web-app>
J'ai bien une classe Action nommé ConfigAddElementAction dans ot.action et une classe pour mon Form-bean ConfigAddElementBean dans ot.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 <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> <jsp:include page="/layout/Header.jsp" flush="true" /> <h1>Configuration des éléments</h1> <h2>Ajout dun nouvel élément</h2> <html:form name="ConfigAddElement" type="ot.form.ConfigAddElementBean" action="ConfigAddElement.do"> Nom : <html:text property="elementName" /> </html:form> <html:link page="/Main.do"> Retour au menu principal </html:link> <jsp:include page="/jsp/Footer.jsp" flush="true" />
Quand je vais sur la page ConfigAddElement.do, la page reste blanche, pas de code source derrière et les logs me disent :
Si dans ma JSP j'enlève les <html:form>, ma page s'affiche correctement. Mais bon je veux afficher mon formulaire
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 15 févr. 2007 10:33:41 org.apache.struts.chain.commands.CreateActionForm execute ATTENTION: No FormBeanConfig found in module under name ConfigAddElemenBean
Merci de m'aider, çà a l'air d'un problème à la con en plus
Partager