IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Struts 1 Java Discussion :

probleme mysterieux d execution


Sujet :

Struts 1 Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Inscrit en
    Septembre 2007
    Messages
    10
    Détails du profil
    Informations forums :
    Inscription : Septembre 2007
    Messages : 10
    Par défaut probleme mysterieux d execution
    slt tlm,

    voila j ai une Action qui me retourne une liste a afficher et dans cette meme Action j insere un element dans une table de ma base

    le probleme est que lorsque je lance l action j insere deux fois, mais lorsque je lance le debugg j insere qu une seule fois, je precise que mes tables ont des cles primaires en int auto incrementées

    eclipse 3.3 mysql navicat vista struts 1.3...


    merci d avance pour vos conseils et reponse,

  2. #2
    Membre confirmé
    Inscrit en
    Janvier 2007
    Messages
    145
    Détails du profil
    Informations forums :
    Inscription : Janvier 2007
    Messages : 145
    Par défaut
    Citation Envoyé par scilab Voir le message
    slt tlm,

    voila j ai une Action qui me retourne une liste a afficher et dans cette meme Action j insere un element dans une table de ma base

    le probleme est que lorsque je lance l action j insere deux fois, mais lorsque je lance le debugg j insere qu une seule fois, je precise que mes tables ont des cles primaires en int auto incrementées

    eclipse 3.3 mysql navicat vista struts 1.3...


    merci d avance pour vos conseils et reponse,
    Salut
    Peut être que ton ajout est fait lors du premier appel de l'action et lors d'un submit
    Peux-tu publier ton code ? à mon avis ça aiderait les autres à t'aider
    Bonne chance

  3. #3
    Membre averti
    Inscrit en
    Septembre 2007
    Messages
    10
    Détails du profil
    Informations forums :
    Inscription : Septembre 2007
    Messages : 10
    Par défaut
    Citation Envoyé par luna007 Voir le message
    Salut
    Peut être que ton ajout est fait lors du premier appel de l'action et lors d'un submit
    Peux-tu publier ton code ? à mon avis ça aiderait les autres à t'aider
    Bonne chance

    listeclient.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
     
     
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
     
    <%@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>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    </head>
    <body>
    <table border="2" align="left">
    <tr>
    <td align="center">id</td>
    <td align="center">nom</td>
    <td align="center">prenom</td>
    <td align="center">adresse</td>
    <td align="center">ville</td>
    <td align="center">pays</td>
    </tr>
    <logic:iterate name="listeclient" id="client">
    <tr>
    <td align="center">${client.idclient}</td>
    <td align="center">${client.nom}</td>
    <td align="center">${client.prenom}</td>
    <td align="center">${client.adresse}</td>
    <td align="center">${client.ville}</td>
    <td align="center">${client.pays}</td>
    <td><html:link action="/commandee.do?idclient=${client.idclient}&nom=${client.nom}&prenom=${client.prenom}&adresse=${client.adresse}&ville=${client.ville}&pays=${client.pays}"><html:button property="bouton" value="passer commande"/></html:link> </td>
    </tr>
    </logic:iterate>
    </table>
     
     
    <table border="5" align="right">
    <tr>
    <td align="center">id</td>
    <td align="center">ref</td>
    <td align="center">nom</td>
    <td align="center">prix</td>
    <td align="center">frais</td>
    <td align="center">quantitedispo</td>
    </tr>
    <logic:iterate name="listeproduit" id="produit">
    <tr>
    <td align="center">${produit.idproduit}</td>
    <td align="center">${produit.ref}</td>
    <td align="center">${produit.nom}</td>
    <td align="center">${produit.prix}</td>
    <td align="center">${produit.frais }</td>
    <td align="center">${produit.quantite}</td>
    <td><html:button property="bouton" value="ajouter"/> </td>
    </tr>
     
    </logic:iterate>
     
    </table>
     
     
    </body>
    </html>

    commande.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
    68
     
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <%@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>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    </head>
    <body>
     
     
     
     
    <table border="2" align="left">
    <tr>
    <td>${idcom }</td>
    <td align="center">id</td>
    <td align="center">ref</td>
    <td align="center">nom</td>
    <td align="center">prix</td>
    <td align="center">frais</td>
    <td align="center">quantitedispo</td>
    </tr>
    <logic:iterate name="listeproduit" id="produit">
    <tr>
    <td align="center">${produit.idproduit}</td>
    <td align="center">${produit.ref}</td>
    <td align="center">${produit.nom}</td>
    <td align="center">${produit.prix}</td>
    <td align="center">${produit.frais }</td>
    <td align="center">${produit.quantite}</td>
    <td><html:link action="/panier.do?produit=${produit.idproduit}&idcomm=${idcom}"><html:button property="bouton" value="ajouter"/></html:link> </td>
    </tr>
     
    </logic:iterate>
     
    </table>
     
    <table border="5" align="right">
     
    <!-- y mettre un logic iterate pour les produits a afficher -->
    <logic:iterate name="listelot" id="lot">
    <tr>
    <td>idcommande</td>
    <td>idproduit</td>
    </tr>
    <tr>
    <td>${lot.idcommande}</td>
    <td>${lot.idproduit}</td>
    </tr>
    </logic:iterate>
     
    <tr>
    <td>Un produit</td>
    </tr>
    <tr>
    <td><html:button property="bouton" value="valider achat"/></td>
    </tr>
    </table>
     
     
    </body>
    </html>

    les fichiers actions:

    ListeClient.java

    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
     
    package com.sylis.ecommerce.struts.action;
     
    import java.util.List;
     
    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 com.sylis.ecommerce.model.Client;
    import com.sylis.ecommerce.model.Produit;
    import com.sylis.ecommerce.model.dao.ClientDAO;
    import com.sylis.ecommerce.model.dao.ProduitDAO;
     
    public class ListeClient extends Action{
     
     
    	public ActionForward execute(ActionMapping mapping, ActionForm form,
    			HttpServletRequest request, HttpServletResponse response)
    	throws Exception {
     
     
    		ClientDAO clientDAO = new ClientDAO();
    		ProduitDAO produitdao = new ProduitDAO();
     
    		List<Client> list = clientDAO.listAll();
    		List<Produit> listp = produitdao.listAll();
     
    		request.setAttribute("listeclient", list);
    		request.setAttribute("listeproduit", listp);
     
    		return mapping.findForward("success");
     
    	}
    }
    Commande.java

    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
     
    package com.sylis.ecommerce.struts.action;
     
    import java.util.List;
     
    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 com.sylis.ecommerce.model.Lot;
    import com.sylis.ecommerce.model.Produit;
    import com.sylis.ecommerce.model.dao.CommandeDAO;
    import com.sylis.ecommerce.model.dao.LotDAO;
    import com.sylis.ecommerce.model.dao.ProduitDAO;
     
    public class Commande extends Action{
     
    	public ActionForward execute(ActionMapping mapping, ActionForm form,
    			HttpServletRequest request, HttpServletResponse response)
    	throws Exception {
     
     
    		int recupidclient = Integer.parseInt(request.getParameter("idclient"));
    		System.out.println(" l id du CLIENT  Commande1   " +recupidclient);
     
    		ProduitDAO produitdao = new ProduitDAO();
    		CommandeDAO commandedao = new CommandeDAO();
    		LotDAO lotdao = new LotDAO();
     
    		  commandedao.save(recupidclient);
     
     
     
     
    		com.sylis.ecommerce.model.Commande ret = commandedao.retrouveidcom(recupidclient);
    		int idcomm = ret.getIdcommande();
     
    		List<Lot> listl = lotdao.listAllcom(idcomm);
    		 List<Produit> listp = produitdao.listAll();
     
    		request.setAttribute("listeproduit", listp);
    		request.setAttribute("listelot", listl);
    		request.setAttribute("idcom", idcomm);
     
    		System.out.println("Action   "+idcomm);
    		return mapping.findForward("success");
     
    	}
     
    }
    DAO :

    ClientDAO.java


    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
     
    package com.sylis.ecommerce.model.dao;
     
    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.util.ArrayList;
    import java.util.List;
     
    import javax.naming.InitialContext;
    import javax.sql.DataSource;
     
    import com.sylis.ecommerce.model.Client;
     
    public class ClientDAO {
     
     
    	private Statement st;
    	/*ouverture connexion*/
    	private void initStatement(){
     
    		try{	
    			DataSource source=(DataSource) new InitialContext().lookup("java:comp/env/jdbc/database_connection");
    			Connection con = source.getConnection();
    			this.st = con.createStatement();
    		}catch(Exception e){
    			e.printStackTrace();
    		}
    	}
     
    	/*fermeture*/
    	private void closeStatement(){
    		try{st.close();
    		}catch(SQLException e){e.printStackTrace();}
    	}
     
     
     
     
    	/*liste  tous tous les produits de la table c_produit*/
    	public List<Client> listAll(){
    		initStatement();
    		List<Client> list = new ArrayList<Client>();
    		String requete =  "select * from client";
    		try{
    			ResultSet rs = st.executeQuery(requete);
     
     
    			while(rs.next()){
    				Client c = new Client();
     
    				c.setIdclient(rs.getInt("idclient"));
    				c.setNom(rs.getString("nom"));
    				c.setPrenom(rs.getString("prenom"));
    				c.setAdresse(rs.getString("adresse"));
    				c.setVille(rs.getString("ville"));
    				c.setPays(rs.getString("pays"));
     
    				list.add(c);
    			}
    		}catch(SQLException er){er.printStackTrace();}
    		closeStatement();
    		return list;
    	}
     
     
    	/*insert ou ajoute un produit dans table c_produit*/
    	public void save(Client client) {
    		// Insert avec les champs de maladie
    		initStatement();
    		String requete = "insert into client (nom,prenom,adresse,ville,pays) values ('"+
    		client.getNom()+"'"+","+"'"+
    		client.getPrenom()+"'"+","+"'"+
    		client.getAdresse()+"'"+","+"'"+
    		client.getVille()+"'"+","+"'"+
    		client.getPays()+"');";
    		System.out.println(requete);
    		try{
     
    			st.executeUpdate(requete);
    		}catch(SQLException e){e.printStackTrace();}
     
    		closeStatement();
    	}
     
     
     
    }
    Commande.java

    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
     
    package com.sylis.ecommerce.model.dao;
     
    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
     
    import javax.naming.InitialContext;
    import javax.sql.DataSource;
     
     
     
    public class CommandeDAO {
     
     
     
     
    	private Statement st;
    	/*ouverture connexion*/
    	private void initStatement(){
     
    		try{	
    			DataSource source=(DataSource) new InitialContext().lookup("java:comp/env/jdbc/database_connection");
    			Connection con = source.getConnection();
    			this.st = con.createStatement();
    		}catch(Exception e){
    			e.printStackTrace();
    		}
    	}
     
    	/*fermeture*/
    	private void closeStatement(){
    		try{st.close();
    		}catch(SQLException e){e.printStackTrace();}
    	}
     
     
     
     
    	/*insert l id client pour creer la commande dans la table commande*/
    	public void save(int id) {
     
    		initStatement();
    		String requete = "insert into commande (idclient) values ("+id+");";
    		System.out.println(requete);
    		try{
     
    			st.executeUpdate(requete);
    		}catch(SQLException e){e.printStackTrace();}
     
    		closeStatement();
     
     
     
     
    	}
     
     
    	public com.sylis.ecommerce.model.Commande retrouveidcom(int idcl){
     
    		initStatement();
    		com.sylis.ecommerce.model.Commande com = new com.sylis.ecommerce.model.Commande();
    		String requete = "select * from commande where idclient = "+idcl+";" ;
    		System.out.println(requete);
    		ResultSet res =null;
    		try{
    			 res = st.executeQuery(requete);
    			if(res.next())
    		//res.first();
    			System.out.println("idcommande vaut dao  "+res.getInt("idcommande"));
    			{
    			System.out.println("LALALA");
    			com.setIdcommande(res.getInt("idcommande"));	
    			System.out.println("LOLOLO");
    			com.setIdclient(res.getInt("idclient"));
    			com.setAdresse(res.getString("adresse"));
    			com.setVille(res.getString("ville"));
    			com.setPays(res.getString("pays"));
     
    			}
     
    		}catch(SQLException e){e.printStackTrace();}
    		try{
    			res.close();
    		}catch(SQLException ze){ze.printStackTrace();}
    		closeStatement();
    		return(com); 	
    	}
     
     
     
     
    }
    mon 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
     
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!--
    	Licensed to the Apache Software Foundation (ASF) under one or more
    	contributor license agreements.  See the NOTICE file distributed with
    	this work for additional information regarding copyright ownership.
    	The ASF licenses this file to You under the Apache License, Version 2.0
    	(the "License"); you may not use this file except in compliance with
    	the License.  You may obtain a copy of the License at
     
    	http://www.apache.org/licenses/LICENSE-2.0
     
    	Unless required by applicable law or agreed to in writing, software
    	distributed under the License is distributed on an "AS IS" BASIS,
    	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    	See the License for the specific language governing permissions and
    	limitations under the License.
    -->
     
    <!DOCTYPE struts-config PUBLIC
              "-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
              "http://struts.apache.org/dtds/struts-config_1_3.dtd">
     
    <!--
    	This is a blank Struts configuration file with an example
    	welcome action/page and other commented sample elements.
     
    	Struts Validator is configured using the factory defaults
    	and is ready-to-use.
     
    	NOTE: If you have a generator tool to create the corresponding Java classes
    	for you, you could include the details in the "form-bean" declarations.
    	Otherwise, you would only define the "form-bean" element itself, with the
    	corresponding "name" and "type" attributes, as shown here.
    -->
     
     
    <struts-config>
     
     
    	<!-- ================================================ Form Bean Definitions -->
     
    	<form-beans>
     
    		<form-bean name="excelForm"
    			type="org.apache.struts.validator.DynaValidatorForm">
    			<form-property name="excelFile"
    				type="org.apache.struts.upload.FormFile" />
    		</form-bean>
     
     
     
    		<form-bean name="ClientForm"
    			type="org.apache.struts.validator.DynaValidatorForm">
    			<form-property name="nom" type="java.lang.String" />
    			<form-property name="prenom" type="java.lang.String" />
    			<form-property name="adresse" type="java.lang.String" />
    			<form-property name="ville" type="java.lang.String" />
    			<form-property name="pays" type="java.lang.String" />
    		</form-bean>
     
     
     
     
     
     
    		<form-bean name="identification"
    			type="org.apache.struts.validator.DynaValidatorForm">
    			<form-property name="log" type="java.lang.String" />
    			<form-property name="pass" type="java.lang.String" />
     
    		</form-bean>
     
     
     
     
    			<!-- sample form bean descriptor for a DynaActionForm
    			<form-bean
    			name="logonForm"
    			type="org.apache.struts.action.DynaActionForm">
    			<form-property
    			name="username"
    			type="java.lang.String"/>
    			<form-property
    			name="password"
    			type="java.lang.String"/>
    			</form-bean>
    			end sample -->
    	</form-beans>
     
     
    	<!-- ========================================= Global Exception Definitions -->
     
    	<global-exceptions>
    		<!-- sample exception handler
    			<exception
    			key="expired.password"
    			type="app.ExpiredPasswordException"
    			path="/changePassword.jsp"/>
    			end sample -->
    	</global-exceptions>
     
     
    	<!-- =========================================== Global Forward Definitions -->
     
    	<global-forwards>
    		<!-- Default forward to "Welcome" action -->
    		<!-- Demonstrates using index.jsp to forward -->
    		<forward name="welcome" path="/Welcome.do" />
    	</global-forwards>
     
     
    	<!-- =========================================== Action Mapping Definitions -->
     
    	<action-mappings>
    		<!-- Default "Welcome" action -->
    		<!-- Forwards to Welcome.jsp -->
     
    		<action path="/ajoutclient"
    			type="com.sylis.ecommerce.struts.action.AjoutClient"
    			name="ClientForm" 
    			validate="true" 
    			input="/ajoutclient.jsp"
    			scope="request">
    			<forward name="success" path="/ajoutclient.jsp" />
     
    		</action>
     
    			<action path="/listeclient"
    			type="com.sylis.ecommerce.struts.action.ListeClient"
    			scope="request">
    			<forward name="success" path="/listeclient.jsp" />
     
    		</action>
     
     
    			<action path="/commandee"
    			type="com.sylis.ecommerce.struts.action.Commande"
    			scope="request">
    			<forward name="success" path="/commande.jsp" />
    		</action>
     
     
    			<action path="/panier"
    			type="com.sylis.ecommerce.struts.action.Panier"
    			scope="request">
    			<forward name="success" path="/commande.jsp" />
    		</action>
     
    <!-- ================================================================================== -->				
    		<action path="/AjoutProduit"
    			type="com.sylis.ecommerce.struts.actions.AjouterProduitAction"
    			name="Produit_form" validate="true" input="/AjouterProduit.jsp"
    			scope="request">
    			<forward name="success" path="/AjouterProduit.jsp" />
    			<!--	<forward name="fail" path="/AjouterProduitbis.jsp"/>-->
    		</action>
     
    		<!--====================================================================-->
     
    		<action path="/supprimerproduit"
    			type="com.sylis.ecommerce.struts.actions.SupprimerProduitAction"
    			name="Produit_form">
    			<forward name="success" path="/listeproduit.do" />
    		</action>
     
    		<!--=====================================================================-->
    		<action path="/listeproduit"
    			type="com.sylis.ecommerce.struts.actions.ListeProduitAction">
    			<!-- 	<forward name="success" path="/listerProduit.jsp"/>-->
    			<forward name="success" path="/SupprimerProduit.jsp" />
    		</action>
    		<!--=====================================================================-->
     
    		<action path="/modifierproduit"
    			type="com.sylis.ecommerce.struts.actions.ModifierProduitAction"
    			scope="session">
    			<forward name="success" path="/ModifierProduit.jsp" />
    		</action>
     
     
    		<!--=====================================================================-->
     
    		<action path="/ajoutermodif"
    			type="com.sylis.ecommerce.struts.actions.ModifierProduitActionvrai"
    			name="Produit_form" validate="true" input="/ModifierProduit.jsp">
    			<!-- quand c faux -->
    			<!-- <forward name="success" path="/ModifierProduit.jsp"/>-->
    			<forward name="success" path="/listeproduit.do" />
    		</action>
     
    		<!--=============pour lire un fichier en dur========================================================-->
    		<action path="/exporter"
    			type="com.sylis.ecommerce.struts.actions.ExporterAction" />
     
     
    		<!--=============uploader========================================================-->
    		<action path="/importerCatalogue"
    			type="com.sylis.ecommerce.struts.actions.ImporterCatalogueAction"
    			name="excelForm">
    			<forward name="success" path="/Importbravo.jsp" />
     
    		</action>
    		<!-- sample input and input submit actions
     
    			<action
    			path="/listMaladie"
    			type="com.sylis.annuaire.struts.actions.ListeMaladieaction">
    			<forward name="success" path="/lister_maladies.jsp"/>
    			</action>
     
    			<action
    			path="/InputSubmit"
    			type="app.InputAction"
    			name="inputForm"
    			scope="request"
    			validate="true"
    			input="/pages/Input.jsp"/>
     
    			<action
    			path="/edit*"
    			type="app.Edit{1}Action"
    			name="inputForm"
    			scope="request"
    			validate="true"
    			input="/pages/Edit{1}.jsp"/>
     
    			end samples -->
    	</action-mappings>
     
     
    	<!-- ======================================== Message Resources Definitions -->
     
    	<message-resources parameter="MessageResources" />
     
     
    	<!-- =============================================== Plug Ins Configuration -->
     
    	<!-- ======================================================= Tiles plugin -->
    	<!--
    		This plugin initialize Tiles definition factory. This later can takes some
    		parameters explained here after. The plugin first read parameters from
    		web.xml, thenoverload them with parameters defined here. All parameters
    		are optional.
    		The plugin should be declared in each struts-config file.
    		- definitions-config: (optional)
    		Specify configuration file names. There can be several comma
    		separated file names (default: ?? )
    		- moduleAware: (optional - struts1.1)
    		Specify if the Tiles definition factory is module aware. If true
    		(default), there will be one factory for each Struts module.
    		If false, there will be one common factory for all module. In this
    		later case, it is still needed to declare one plugin per module.
    		The factory will be initialized with parameters found in the first
    		initialized plugin (generally the one associated with the default
    		module).
    		true : One factory per module. (default)
    		false : one single shared factory for all modules
    		- definitions-parser-validate: (optional)
    		Specify if xml parser should validate the Tiles configuration file.
    		true : validate. DTD should be specified in file header (default)
    		false : no validation
     
    		Paths found in Tiles definitions are relative to the main context.
     
    		To use this plugin, download and add the Tiles jar to your WEB-INF/lib
    		directory then uncomment the plugin definition below.
     
    		<plug-in className="org.apache.struts.tiles.TilesPlugin" >
     
    		<set-property property="definitions-config"
    		value="/WEB-INF/tiles-defs.xml" />
    		<set-property property="moduleAware" value="true" />
    		</plug-in>
    	-->
     
     
    	<!-- =================================================== Validator plugin -->
     
    	<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
    		<set-property property="pathnames"
    			value="/org/apache/struts/validator/validator-rules.xml,
                   /WEB-INF/validation.xml" />
    	</plug-in>
     
    </struts-config>
    Merci encore....

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [FEDORA] Problème à l'exécution de Nagios 2.2
    Par fara morgana dans le forum RedHat / CentOS / Fedora
    Réponses: 5
    Dernier message: 22/03/2007, 17h30
  2. [C++.NET] Probleme a l'execution de mon appli
    Par raboin dans le forum VC++ .NET
    Réponses: 9
    Dernier message: 24/04/2006, 13h50
  3. problem dans l'execution de"regedit"
    Par Tiesto dans le forum Sécurité
    Réponses: 5
    Dernier message: 28/12/2005, 21h18
  4. probleme ordre d'execution de ma page asp
    Par Shosho dans le forum ASP
    Réponses: 5
    Dernier message: 10/05/2005, 14h51
  5. [TP]Problème de programme exécutable en mode graphique
    Par GoodVibe dans le forum Turbo Pascal
    Réponses: 2
    Dernier message: 24/09/2004, 09h47

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo