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 :

[ Struts ][ config ]


Sujet :

Struts 1 Java

  1. #1
    Membre confirmé
    Profil pro
    Inscrit en
    Août 2005
    Messages
    221
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2005
    Messages : 221
    Par défaut [ Struts ][ config ]
    Bonjour,

    Peux-t-on passer plusieurs arguments à une action dans le struts config?
    je m'explique, par exemple:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
     
            <action
                attribute="loginForm"
                input="conges.login"
                name="loginForm"
                parameter="event","submit"
    En effet je souhaite utiliser le lookupDispatchAction sans avoir recours à du javascript, et du coup il faut que je rajoute un parameter à mon action.

    Suis-je donc obligé de déclaré un parameter submit ou est ce que je peux me débrouiller avec mon event? (Dans toutes les explications que j'ai vu sur le net a priori submit à l'air d'etre reconnue tout seul...)

    Merci!!

  2. #2
    Expert confirmé

    Femme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    5 793
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Juillet 2005
    Messages : 5 793
    Par défaut
    La LookupDispatchAction est utilisée justement quand on ne veut pas avoir recours à du Javascript, et fonctionne grâce au paramètre que l'on précise dans l'attribut parameter dans le mapping de l'Action.

    Pour information, rien ne t'oblige à appeler ce paramètre submit.
    Tu peux donc lui donner n'importe quel nom, comme par exemple event.

    Dans ce cas, il faudra mettre aussi event dans l'attribut property de chaque balise html:submit comme ceci :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <html:submit property="event">

  3. #3
    Membre confirmé
    Profil pro
    Inscrit en
    Août 2005
    Messages
    221
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2005
    Messages : 221
    Par défaut
    ok,
    je test tout de suite, si ca mrche tu es mon sauveur

  4. #4
    Membre confirmé
    Profil pro
    Inscrit en
    Août 2005
    Messages
    221
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2005
    Messages : 221
    Par défaut
    j'ai un petit problème car je n'ai rien qui se passe après avoir modifier mon code !!

    Voici mon action qui hérite de LookupDispatchAction
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    	public ActionForward affichageDemandeFiltre(
    			ActionMapping mapping,
    			ActionForm form,
    			HttpServletRequest request,
    			HttpServletResponse response) throws BDException
    			{
    				System.out.println("COUCOU");
    				return mapping.findForward("defautSession");
    			}
    ainsi que sa méthode getKeyMethodMap
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    	protected Map getKeyMethodMap() {
    		Map map = new HashMap();
    		map.put("filtre.demande","affichageDemandeFiltre");
    		map.put("init.validateur","initValidateur");
    		return map;
    	}
    mon ressource properties
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    # Messages généraux
    filtre.demande = affichageDemandeFiltre
    init.validateur = initValidateur
    et ma JSP
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    			<td>
    				<html:submit property="event" value="Appliquer">
    					<bean:message key="filtre.demande"/>
    				</html:submit>
    			</td>

    Ou peut il y avoir une erreur? (Le message COUCOU ne s'affiche pas sur la console...)

  5. #5
    Expert confirmé

    Femme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    5 793
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Juillet 2005
    Messages : 5 793
    Par défaut
    Essaie en enlevant l'attribut value dans le tag html:submit comme ceci :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
     
    		<html:submit property="event">
    			<bean:message key="filtre.demande"/>
    		</html:submit>

  6. #6
    Membre confirmé
    Profil pro
    Inscrit en
    Août 2005
    Messages
    221
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2005
    Messages : 221
    Par défaut
    Nan j'ai toujours pas de message qui s'affiche dans la console !!
    La seule qui a changé c'est le nom du bouton qui est maintenant celui référencé par la clé du fichier properties...

  7. #7
    Membre confirmé
    Profil pro
    Inscrit en
    Août 2005
    Messages
    221
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2005
    Messages : 221
    Par défaut
    Est ce qu'il faudrait pas un <html:form> particulier ou un truc dans ce genre?
    J'ai remarqué aussi que je devais mettre dans la méthode qui gère la hashMap le nom de toute les fonctions de mon action et reporté ces noms dans le properties.....

    N'y aurait il pas d'autre chose "implicite" à faire que j'aurai oublié?

  8. #8
    Expert confirmé

    Femme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    5 793
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Juillet 2005
    Messages : 5 793
    Par défaut
    Tu as bien mis parameter="event" dans le mapping de ton Action dans le struts-config.xml ?

  9. #9
    Membre confirmé
    Profil pro
    Inscrit en
    Août 2005
    Messages
    221
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2005
    Messages : 221
    Par défaut
    oui oui

    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
            <action
                attribute="demandeForm"
                input="conges.demande"
                name="demandeForm"
                parameter="event"
                path="/demandeInit"
                type="com.conges.action.DemandeAction"
                validate="false">
                <forward name="init" path="conges.demande" />
                <forward name="reload" path="/demandeInit.do?event=init" />
                <forward name="echec" path="conges.demande" />
            </action>
            <action
                attribute="demandeForm"
                input="conges.demande"
                name="demandeForm"
                parameter="event"
                path="/demande"
                type="com.conges.action.DemandeAction">
                <forward name="success" path="/confirmationDemande.do?event=init" />
                <forward name="reload" path="/demandeInit.do?event=init" />
            </action>
    J'ai meme dédoublé l'action a cause de mon validateur...

  10. #10
    Membre confirmé
    Profil pro
    Inscrit en
    Août 2005
    Messages
    221
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2005
    Messages : 221
    Par défaut
    En mettant des points d'arret dans Eclipse, je confirme qu'aucune méthode n'est appelé qd je clique sur le bouton....

  11. #11
    Expert confirmé

    Femme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    5 793
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Juillet 2005
    Messages : 5 793
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    	public ActionForward affichageDemandeFiltre(
    			ActionMapping mapping,
    			ActionForm form,
    			HttpServletRequest request,
    			HttpServletResponse response) throws BDException
    			{
    				System.out.println("COUCOU");
    				return mapping.findForward("defautSession");
    			}
    Dans ton struts-config.xml, je ne vois pas de définition du forward de name="defautSession" ?

    Sinon, as-tu un message d'erreur dans la console ?

  12. #12
    Membre confirmé
    Profil pro
    Inscrit en
    Août 2005
    Messages
    221
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2005
    Messages : 221
    Par défaut
    nan je n'ai aucun message d'erreur dans la console...

    Le forward defautSession est un global forward en fait....Je le vérifie immédiatement....

  13. #13
    Membre confirmé
    Profil pro
    Inscrit en
    Août 2005
    Messages
    221
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2005
    Messages : 221
    Par défaut
    c'est bien un global forward qui justement permet de me renvoyer sur une autre page, donc du coup je visualise plus facilement si je passe bien ou non dans la méthode affichageDemandeFiltre de la classe action...

  14. #14
    Expert confirmé

    Femme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    5 793
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Juillet 2005
    Messages : 5 793
    Par défaut
    Je ne comprends pas, ça devrait fonctionner.

    Je ne vois rien d'anormal à part le au lieu de .
    Ce n'est pourtant pas la première fois que je dépanne sur la LookupDispatchAction.

    Mais bon, c'est Vendredi, peut-être que je n'ai pas les yeux en face des trous.

  15. #15
    Membre confirmé
    Profil pro
    Inscrit en
    Août 2005
    Messages
    221
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2005
    Messages : 221
    Par défaut
    T'inkiètes pas j'ai surement pas les yeux en face des trous non plus !!!

    Vais suivre ta remarque et faire un tour du coté de mes exceptions...

  16. #16
    Expert confirmé

    Femme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    5 793
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Juillet 2005
    Messages : 5 793
    Par défaut
    Tu n'aurais pas tout simplement un problème de validation, ce qui expliquerait qu'il n'exécute pas l'Action.

  17. #17
    Membre confirmé
    Profil pro
    Inscrit en
    Août 2005
    Messages
    221
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2005
    Messages : 221
    Par défaut
    ben nan, j'ai pas de méthode validate dans l'action ...........

    Voici la classe action en entier
    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
    package com.conges.action;
     
    import java.sql.SQLException;
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.Map;
     
    import javax.naming.NamingException;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
     
    import org.apache.log4j.Logger;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import org.apache.struts.action.ActionMessage;
    import org.apache.struts.action.ActionMessages;
    import org.apache.struts.actions.LookupDispatchAction;
     
    import com.conges.beans.BeanAgent;
    import com.conges.beans.BeanLogin;
    import com.conges.context.Constantes;
    import com.conges.form.DemandeForm;
    import com.conges.jdbc.BDException;
    import com.conges.services.AgentServices;
    import com.conges.services.DemandeServices;
    import com.conges.util.DateHelper;
     
     
    /** DemandeAction.java */
     
    public class DemandeAction extends LookupDispatchAction {
     
    	// --------------------------------------------------------- Instance Variables
     
    	/** Objet trace pour les logs. */ 
    	private static Logger logger = Logger.getLogger(DemandeAction.class);
     
    	// --------------------------------------------------------- Methods
     
    	/**
             * Permet d'initialiser la page demande.jsp
             * @param mapping L'objet representant le struts-config en mémoire
             * @param form Le formulaire associé à l'action
             * @param request L'objet Request
             * @param response L'objet Response
             * @return L'instance ActionForward correspondant aux tests
             */
    	public ActionForward init(
    		ActionMapping mapping,
    		ActionForm form,
    		HttpServletRequest request,
    		HttpServletResponse response)
    		{
     
    			logger.debug("ENTREE");
    			HttpSession session = request.getSession(false);
    			if(session.isNew() && request.isRequestedSessionIdValid() == false){
    				logger.debug("DEFAUT SESSION");
    				return mapping.findForward("defautSession");
    			}
     
    			BeanLogin beanLogin = (BeanLogin) session.getAttribute(Constantes.LOGIN);
    			BeanAgent beanAgent = (BeanAgent) session.getAttribute(Constantes.AGENT);
    			ArrayList listeDemandes = new ArrayList();
     
    			if(beanLogin.getNoDossierPers() == null || beanAgent.getAnneeUniversitaire() == null )
    				return mapping.findForward(Constantes.FORWARD_ECHEC);
     
    			try{
    				listeDemandes = DemandeServices.getInstance().ObtenirDemandesAgent(beanLogin.getNoDossierPers(),beanAgent.getAnneeUniversitaire());
    				request.getSession().setAttribute(Constantes.DEMANDES_DEMANDES,listeDemandes);
    			}
    			catch(NamingException n){
    				return mapping.findForward(Constantes.FORWARD_ERREUR_NAMING);					
    			}
    			catch(SQLException s){
    				return mapping.findForward(Constantes.FORWARD_ERREUR_SQL);
    			}
     
    			logger.debug("SORTIE");
    			return mapping.findForward(Constantes.FORWARD_INIT);
    	}
     
    	/**
             * Permet d'initialiser la page demande.jsp pour le validateur
             * @param mapping L'objet representant le struts-config en mémoire
             * @param form Le formulaire associé à l'action
             * @param request L'objet Request
             * @param response L'objet Response
             * @return L'instance ActionForward correspondant aux tests
             */
    	public ActionForward initValidateur(
    			ActionMapping mapping,
    			ActionForm form,
    			HttpServletRequest request,
    			HttpServletResponse response)
    			{
     
    				logger.debug("ENTREE");
    				HttpSession session = request.getSession(false);
    				if(session.isNew() && request.isRequestedSessionIdValid() == false){
    					logger.debug("DEFAUT SESSION");
    					return mapping.findForward("defautSession");
    				}
     
    				BeanLogin beanLogin = (BeanLogin) session.getAttribute(Constantes.LOGIN);
    				BeanAgent beanAgent = (BeanAgent) session.getAttribute(Constantes.AGENT);
    				ArrayList listeAgent = new ArrayList();
    				String numeroDossier = "";
     
    				if(beanLogin.getNoDossierPers() == null || beanAgent.getAnneeUniversitaire() == null )
    					return mapping.findForward(Constantes.FORWARD_ECHEC);
     
    				try{
    					listeAgent = AgentServices.getInstance().ObtenirAgentServiceSansChef(beanLogin.getNoDossierPers());
    					session.setAttribute(Constantes.DEMANDES_AGENT_SERVICE_SANS_CHEF,listeAgent);
    					numeroDossier = beanLogin.getNoDossierPers();
    					session.setAttribute(Constantes.PROFIL_VALIDATEUR,numeroDossier);
    				}
    				catch(NamingException n){
    					return mapping.findForward(Constantes.FORWARD_ERREUR_NAMING);					
    				}
    				catch(SQLException s){
    					return mapping.findForward(Constantes.FORWARD_ERREUR_SQL);
    				}
     
    				logger.debug("SORTIE");
    				return mapping.findForward(Constantes.FORWARD_INIT);
    		}
     
    	/**
             * Permet d'effectuer une demande de congés si celle-ci est valide
             * @param mapping L'objet representant le struts-config en mémoire
             * @param form Le formulaire associé à l'action
             * @param request L'objet Request
             * @param response L'objet Response
             * @return L'instance ActionForward correspondant aux tests
             */
    	public ActionForward traitement(
    		ActionMapping mapping,
    		ActionForm form,
    		HttpServletRequest request,
    		HttpServletResponse response)
    		{
    			logger.debug("ENTREE");
    			HttpSession session = request.getSession(false);
    			if(session.isNew() && request.isRequestedSessionIdValid() == false){
    				logger.debug("DEFAUT SESSION");
    				return mapping.findForward("defautSession");
    			}
     
    			ActionMessages erreurs = new ActionMessages();
    			DemandeForm demandeForm = (DemandeForm)form;
     
    			/* verification de la validité des dates */
    			if(!DateHelper.verifValideDate(demandeForm.getDateDebut()) || !DateHelper.verifValideDate(demandeForm.getDateFin())){
    				erreurs.add(Constantes.DEMANDES_DATE_INVALIDE,new ActionMessage(Constantes.DEMANDES_DATE_INVALIDE));
    				saveErrors(request,erreurs);
    				return mapping.findForward(Constantes.FORWARD_RELOAD);
    			}
    			if(!DateHelper.date1Inferieurdate2(demandeForm.getDateDebut(),demandeForm.getDebutMoitie(),demandeForm.getDateFin(),demandeForm.getFinMoitie())){
    				erreurs.add(Constantes.DEMANDES_DATE_SUPERIEUR,new ActionMessage(Constantes.DEMANDES_DATE_SUPERIEUR));
    				saveErrors(request,erreurs);
    				return mapping.findForward(Constantes.FORWARD_RELOAD);
    			}
     
    			BeanAgent beanAgent;
    			BeanLogin beanLogin;
    			beanLogin = (BeanLogin) session.getAttribute(Constantes.LOGIN);
    			beanAgent  = (BeanAgent) session.getAttribute(Constantes.AGENT);
     
    			if(beanLogin.getNoDossierPers() == null || beanAgent.getAnneeUniversitaire() == null ||
    					demandeForm.getDateDebut() ==null ||demandeForm.getDateFin() == null ||
    					demandeForm.getDebutMoitie() == null || demandeForm.getFinMoitie() == null ||
    					demandeForm.getTypeConges() == null)
    				return mapping.findForward(Constantes.FORWARD_ECHEC);
     
    			int exploitation[];	
     
    			try{
    				exploitation = DemandeServices.getInstance().insererDemandeAgent(beanLogin.getNoDossierPers(),beanAgent.getAnneeUniversitaire(),
    						demandeForm.getDateDebut(),demandeForm.getDebutMoitie(),demandeForm.getDateFin(),
    						demandeForm.getFinMoitie(),demandeForm.getTypeConges());
    				if(exploitation[0] == 1){
    					logger.debug("SUCCESS");
    					return mapping.findForward(Constantes.FORWARD_SUCCESS);							
    				}
    				else{
    					if(exploitation[0] == 2)
    						erreurs.add(Constantes.DEMANDES_PLANNING_INVALIDE,new ActionMessage(Constantes.DEMANDES_PLANNING_INVALIDE));
    					else if(exploitation[0] == 3)
    						erreurs.add(Constantes.DEMANDES_PLANNING_NON_CONTINU,new ActionMessage(Constantes.DEMANDES_PLANNING_NON_CONTINU));
    					else if(exploitation[0] == 4)
    						erreurs.add(Constantes.DEMANDES_CHEVAUCHEMENT,new ActionMessage(Constantes.DEMANDES_CHEVAUCHEMENT));
    					else if(exploitation[0] == 5)
    						erreurs.add(Constantes.DEMANDES_NOMBRE_DEMI_JOURNEE,new ActionMessage(Constantes.DEMANDES_NOMBRE_DEMI_JOURNEE));
    					else if(exploitation[0] == 6)
    						erreurs.add(Constantes.DEMANDES_SOLDE_INSUFFISANT,new ActionMessage(Constantes.DEMANDES_NOMBRE_DEMI_JOURNEE));
    					saveErrors(request,erreurs);
    				}
    			}
    			catch(NamingException n){
    				return mapping.findForward(Constantes.FORWARD_ERREUR_NAMING);					
    			}
    			catch(SQLException s){
    				return mapping.findForward(Constantes.FORWARD_ERREUR_SQL);
    			}
     
     
    			logger.debug("RELOAD");
    			return mapping.findForward(Constantes.FORWARD_RELOAD);							
    		}
     
    	public ActionForward affichageDemandeFiltre(
    			ActionMapping mapping,
    			ActionForm form,
    			HttpServletRequest request,
    			HttpServletResponse response)
    			{
    				System.out.println("COUCOU");
    				return mapping.findForward("defautSession");
    			}
     
    	/**
             * Permet d'annuler une demande
             * @param mapping L'objet representant le struts-config en mémoire
             * @param form Le formulaire associé à l'action
             * @param request L'objet Request
             * @param response L'objet Response
             * @return L'instance ActionForward correspondant aux tests
             */
    	public ActionForward annulerDemande (
    			ActionMapping mapping,
    			ActionForm form,
    			HttpServletRequest request,
    			HttpServletResponse response)
    			{
    				logger.debug("ENTREE");
    				HttpSession session = request.getSession(false);
     
    				if(session.isNew() && request.isRequestedSessionIdValid() == false){
    					logger.debug("DEFAUT SESSION");
    					return mapping.findForward("defautSession");
    				}
     
    				BeanLogin beanLogin = (BeanLogin) session.getAttribute(Constantes.LOGIN);
    				BeanAgent beanAgent = (BeanAgent) session.getAttribute(Constantes.AGENT);
     
    				if(beanLogin.getNoDossierPers() == null || beanAgent.getAnneeUniversitaire() == null)
    					return mapping.findForward(Constantes.FORWARD_ECHEC);
     
    				try{
    					DemandeServices.getInstance().annulerDemandeAgent(beanLogin.getNoDossierPers(),beanAgent.getAnneeUniversitaire(),
    							request.getParameter(Constantes.DEMANDES_ID_CONGES));
    				}
    				catch(NamingException n){
    					return mapping.findForward("erreurNaming");					
    				}
    				catch(SQLException s){
    					return mapping.findForward("erreurSQL");
    				}
     
    				logger.debug("SORTIE");
    				return mapping.findForward(Constantes.FORWARD_RELOAD);							
    			}
     
    	protected Map getKeyMethodMap() {
    		Map map = new HashMap();
    		map.put("filtre.demande","affichageDemandeFiltre");
    		map.put("init","init");
    		map.put("init.validateur","initValidateur");
    		map.put("traitement","traitement");
    		map.put("annuler.demande","annulerDemande");
    		return map;
    	}
    }
    Je te donne aussi un bout de JSP un peu plus conséquent...
    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
    <html:form action="/demande.do?event=traitement">
     
    <logic:present name="profilValidateur">
     
    	<jsp:include page="filtreAgent.jsp" />
     
    	<table width=300 align="center">
    		<tr>
    			<td align="center">
    			<html:select property="agentSelectionne">
    					<html:option value="0">Toutes</html:option>
    					<html:option value="1">En attentes</html:option>
    					<html:option value="2">Validées</html:option>
    					<html:option value="4">Refusées</html:option>
    					<html:option value="5">Annulées après validation</html:option>
    			</html:select>
    			</td>
    			<td>
    				<html:submit property="event">
    					<bean:message key="filtre.demande"/>
    				</html:submit>
    			</td>
    		</tr>	
    	</table>
     
    </logic:present>	
     
    <logic:notPresent name="profilValidateur">
     
    	<table width="900"  border="0" cellspacing="0" cellpadding="0" align="center">
    	<tr>
    		<td colspan="5" align="center">
    			<b>Récapitulatif des demandes de 2006</b>
    		</td>
    	</tr>
    	</table>
    .............................

  18. #18
    Expert confirmé

    Femme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    5 793
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Juillet 2005
    Messages : 5 793
    Par défaut
    Tu as codé ceci dans le tag html:form :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <html:form action="/demande.do?event=traitement">
    moi, je coderais plutôt ceci :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <html:form action="demande">

  19. #19
    Membre confirmé
    Profil pro
    Inscrit en
    Août 2005
    Messages
    221
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2005
    Messages : 221
    Par défaut
    toujours rien
    je commence à désespérer......

    Ca doit être encore une erreur de frappe a la con quelque part........

  20. #20
    Membre confirmé
    Profil pro
    Inscrit en
    Août 2005
    Messages
    221
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2005
    Messages : 221
    Par défaut
    au fait je suis en Struts 1.1........ca change quelque chose?

Discussions similaires

  1. [Struts] [Tomcat] problème struts-config
    Par danyboy85 dans le forum Tomcat et TomEE
    Réponses: 7
    Dernier message: 10/02/2006, 14h50
  2. [Struts] Problème avec struts-config.xml
    Par The_freeman dans le forum Struts 1
    Réponses: 6
    Dernier message: 29/01/2006, 22h55
  3. [ Sruts ] [xdoclet] Génération du struts-config.xml
    Par acheda dans le forum Struts 1
    Réponses: 7
    Dernier message: 03/03/2005, 09h45
  4. [Struts][struts-config.xml] question sur l element action
    Par SEMPERE Benjamin dans le forum Struts 1
    Réponses: 3
    Dernier message: 08/10/2004, 16h25
  5. [struts]: struts-config.xml
    Par sleepy2002 dans le forum Struts 1
    Réponses: 2
    Dernier message: 01/10/2004, 10h32

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