Bonjour,
J'essaye de construire ma première application Struts 2 et j'ai téléchargé la version 2.3.4.1.
J'ai cherché des cours pour commencer sauf que je n'ai pas compris quel fichier de configuration je dois l'appliquer.
Je m'explique, j'ai trouvé dans des tutoriels :
struts.xml
et dans d'autres
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 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <constant name="struts.devMode" value="true" /> <package name="helloworld" extends="struts-default"> <action name="hello" class="com.tutorialspoint.struts2.HelloWorldAction" method="execute"> <result name="success">/HelloWorld.jsp</result> </action> <-- more actions can be listed here --> </package> <-- more packages can be listed here --> </struts>
struts-config.xml:
Donc lequel dois-je suivre ?
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 <?xml version="1.0" encoding="UTF-8"?> <!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="frmPersonne" type="org.apache.struts.validator.DynaValidatorForm"> <form-property name="login" type="java.lang.String" initial=""/> <form-property name="pwd" type="java.lang.String" initial=""/> </form-bean> </form-beans> <action-mappings> <action path="/main" name="frmPersonne" scope="session" validate="true" input="/erreurs.do" parameter="/main.do" type="istia.st.struts.controle.FormulaireAction"> <forward name="reponse" path="/vues/reclamation/acceuilreclamation.jsp"/> <forward name="echec" path="/vues/authen/erreurs.personne.jsp"/> <forward name="erreur" path="/vues/authen/reponse.personne.jsp"/> </action> <action path="/erreurs" parameter="/vues/authen/erreurs.personne.jsp" type="org.apache.struts.actions.ForwardAction" /> <action path="/reponse" parameter="/vues/authen/reponse.personne.jsp" type="org.apache.struts.actions.ForwardAction" /> <action path="/formulaire" parameter="/vues/authen/formulaire.personne.jsp" type="org.apache.struts.actions.ForwardAction" /> </action-mappings> <message-resources parameter="ressources.personneressources"/> <plug-in className="org.apache.struts.validator.ValidatorPlugIn"> <set-property property="pathnames" value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml" /> </plug-in> </struts-config>
Quelqu'un saurait-il m'indiquer un tutoriel pour Struts 2 avec JBoss As7 ?
Merci d'avance pour votre aide.
Partager