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

JSF Java Discussion :

Sauvegarder un formulaire JSF avec JDBC


Sujet :

JSF Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Femme Profil pro
    Inscrit en
    Mai 2011
    Messages
    177
    Détails du profil
    Informations personnelles :
    Sexe : Femme

    Informations forums :
    Inscription : Mai 2011
    Messages : 177
    Par défaut Sauvegarder un formulaire JSF avec JDBC
    bonjour,
    j'ai crée une méthode qui sauvegarde les données dans la base de donnée et ça fonctionne correctement.maintenant j'ai mis en place un formulaire en jsf et j'aimerais bien sauvegarder les champs dans ma base de donnée.Ja'i essayé d'appeler ma methode de sauvegarde dans la page jsf( qui marche très bien) mais elle ne marche pas.
    voci mon code jsf
    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
     
    <?xml version='1.0' encoding='UTF-8' ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:p="http://primefaces.org/ui">
        <h:head>
            <title> new data </title>
        </h:head>
        <h:body>
     
          <ui:include src="header.xhtml" />
     
                <p:panel header="General">  
                    <h:panelGrid columns="2">  
                        <h:outputText value="Societé  " />  
                        <p:selectOneMenu value="#{nouvelleCompagne.societe}">  
                            <f:selectItem itemLabel="choisissez votre societé" itemValue="" />  
                            <f:selectItem itemLabel="Somatel" itemValue="somatel" />  
                            <f:selectItem itemLabel="Syscomedia" itemValue="syscomedia" />  
                            <f:selectItem itemLabel="Option 3" itemValue="option3" />  
                        </p:selectOneMenu> 
     
                        <h:outputText value="Nom Compagne " />  
                        <p:inputText id="NomCompagne" value="#{nouvelleCompagne.compagne}"/>  
     
     
                        <h:outputText value="Description " />  
                        <p:inputTextarea rows="4" cols="60" value="#{nouvelleCompagne.description}"/>  
     
                    </h:panelGrid> 
                </p:panel>
                <p:panel header="Budget et Invistissement"> 
                    <h:panelGrid columns="2">  
                        <h:outputText value="Type compagne"  />  
                        <p:selectOneRadio id="options" value="#{nouvelleCompagne.type_compagne}"  >  
                            <f:selectItem itemLabel="A" itemValue="A" />  
                            <f:selectItem itemLabel="B" itemValue="B" />    
                        </p:selectOneRadio>  
     
                        <h:outputText value="Prix Unitaire" /> 
                        <p:inputText id="PrixUnitaire" required="true" value="#{nouvelleCompagne.prix_unitaire}"/>  
     
     
                        <h:outputText value="Type d'investissement" />
                        <p:selectOneRadio id="options1" value="#{nouvelleCompagne.type_invest}">  
     
                                <f:selectItem itemLabel="Budget" itemValue="budget" />                  
                                <f:selectItem itemLabel="Nombre" itemValue="nb" /> 
                        </p:selectOneRadio>
     
     
                        <h:outputText value="Critère d'envoi" />
                        <p:selectManyCheckbox  value="#{nouvelleCompagne.critere_envoi}">  
                            <f:selectItem itemLabel="Sex" itemValue="sex" />  
                            <f:selectItem itemLabel="Age" itemValue="age" />  
                            <f:selectItem itemLabel="Ville" itemValue="ville" />  
                            <f:selectItem itemLabel="Revenu" itemValue="revenu" /> 
                        </p:selectManyCheckbox>  
     
                        <p:separator  />   <p:separator  />  
                        <!-- style="width:500px;height:20px;color:red;" -->
     
     
                    </h:panelGrid>  
                </p:panel>  
               <p:panel header="Cible et Critere"> 
                    <h:panelGrid columns="2">  
                        <h:outputText value="Public visé " />  
                        <p:selectOneRadio id="options3" value="#{nouvelleCompagne.public_vise}">  
                            <f:selectItem itemLabel="ALL" itemValue="all" />  
                            <f:selectItem itemLabel="Male" itemValue="male" /> 
                            <f:selectItem itemLabel="Femèle" itemValue="femele" />
                        </p:selectOneRadio>  
     
                        <h:outputText value="Tranche d'âge " />  
                        <p:selectOneRadio id="options4" value="#{nouvelleCompagne.tranche_age}">  
                            <f:selectItem itemLabel="ALL" itemValue="all" />  
                            <f:selectItem itemLabel="Interval Age" itemValue="Interval Age" /> 
     
                        </p:selectOneRadio>   
     
                      <h:outputText value="Revenue " />  
                        <p:selectManyCheckbox value="#{nouvelleCompagne.consommation}">  
                            <f:selectItem itemLabel="High" itemValue="high gros client" />  
                            <f:selectItem itemLabel="Upper medium" itemValue="upper medium" />  
                            <f:selectItem itemLabel="Medium" itemValue="medium" />  
                            <f:selectItem itemLabel="Lower Medium" itemValue="lower medium" /> 
                            <f:selectItem itemLabel="Low" itemValue="low" />  
                            <f:selectItem itemLabel="Under" itemValue="under" /> 
                        </p:selectManyCheckbox>  
     
     
                           <h:outputText value="Critère ville " />  
                        <p:selectOneRadio id="options5" value="#{nouvelleCompagne.critere_ville}">  
                            <f:selectItem itemLabel="ville specifique" itemValue="ville specifique" />  
                            <f:selectItem itemLabel="delegation specifique" itemValue="delegation specifique" /> 
     
                        </p:selectOneRadio>   
     
     
                        <p:outputLabel value="Total Client sélectionnés " />
                        <p:outputLabel value="0" style="color:blue"/>
                        <p:outputLabel value="Budget estimé " />
                        <p:outputLabel value="0" style="color:blue" />
                    </h:panelGrid> 
                </p:panel> 
     
                <p:commandButton value="OK" action="test2.xhtml" />
                <p:commandButton value="save" action="#{nouvelleCompagne.addCompagne(name, description, texte, header, budget, nb)}" />
        </h:body>
    </html>

    et voici mon bean
    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
     
     
    /*
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */
    package com.bean;
     
    import java.io.Serializable;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.util.List;
    import java.util.logging.*;
    import javax.faces.bean.ManagedBean;
    import javax.faces.bean.SessionScoped;
    //import javax.persistence.Entity;
     
    /**
     *
     * @author Haythem
     */
     
    @ManagedBean
    @SessionScoped
    public class NouvelleCompagne implements Serializable{
     
        static Logger log = Logger.getLogger(NouvelleCompagne.class.getName());
        // paramètres générals
       private String societe;
       private String compagne;
       private String description;
     
        // paramètres budget & investissement
       private String type_compagne;
       private double prix_unitaire;
       private String type_invest;
     
       private String texte;
       private String header;
     
     
     
       private List<String> critere_envoi;
     
        // cibles et critères
       private String public_vise;
       private String tranche_age;
       private List<String> consommation;
       private String critere_ville;
     
        //somme total
       private double budget_estime;
       private int nbre_clients;
     
     
     
     
        /*---------------------------------------------------------------
         *  DIVERS METHODES
         *---------------------------------------------------------------
         */
     
        public double calculeSomme(double prix_unitaire, int nb){
     
            budget_estime= prix_unitaire* nb;
            return budget_estime;
        }
     
     
     
        public static Boolean AddCompagne(String name, String description, String texte, String header, Double budget, int nb)
    	{
    	Statement stmt = null;	
            Boolean res=false;
            Connection conn=null;
    	String sqlInsert= "insert into compagne (name , description, texte, header, budget, nb ) values ('"+ name + "' , '"+ description + "', '"+ texte + "', '"+ header + "', '"+ budget + "', '"+ nb+ "')";
     
            try
    		{
                        System.out.println("1");
                            conn=com.util.ConnectionPool.getConnection();
                            System.out.println("2");
    			stmt = conn.createStatement();
                            System.out.println("3");
    			stmt.execute(sqlInsert);
                            System.out.println("success");
    			conn.commit();
    			res = true;
    		} 
    		catch (SQLException e) 
    		{
    			try 
    			{
                                System.out.println("erreur");
    				conn.rollback();				
    			} 
    			catch (SQLException e1) 
    			{
    				//log.error(e1.getMessage());
                                System.out.println("erreur2");
    				e1.printStackTrace();
    			}
    			//log.error(e.getMessage());	
    			e.printStackTrace();
    		}
    		finally
    		{
    			try 
    			{
    				stmt.close();				
    			} 
    			catch (SQLException e) 
    			{
    				//log.error(e.getMessage());
    				e.printStackTrace();
    			}
    		}
    		//log.debug("New Client Inserted:"+res+"\n");
    		return res;
    	}
     
     
     
     
     
     
         /*------------------------------------------------------------------------------------------------
        ----------------------------------- GETTER AND SETTER --------------------------------------------
         * -----------------------------------------------------------------------------------------------
         */
     
        public double getBudget_estime() {
            return budget_estime;
        }
     
        public void setBudget_estime(double budget_estime) {
            this.budget_estime = budget_estime;
        }
     
        public String getCompagne() {
            return compagne;
        }
     
        public void setCompagne(String compagne) {
            this.compagne = compagne;
        }
     
     
     
        public List<String> getCritere_envoi() {
            return critere_envoi;
        }
     
        public List<String> getConsommation() {
            return consommation;
        }
     
        public void setConsommation(List<String> consommation) {
            this.consommation = consommation;
        }
     
        public void setCritere_envoi(List<String> critere_envoi) {
            this.critere_envoi = critere_envoi;
        }
     
     
        public String getDescription() {
            return description;
        }
     
        public void setDescription(String description) {
            this.description = description;
        }
     
        public int getNbre_clients() {
            return nbre_clients;
        }
     
        public void setNbre_clients(int nbre_clients) {
            this.nbre_clients = nbre_clients;
        }
     
        public double getPrix_unitaire() {
            return prix_unitaire;
        }
     
        public void setPrix_unitaire(double prix_unitaire) {
            this.prix_unitaire = prix_unitaire;
        }
     
        public String getPublic_vise() {
            return public_vise;
        }
     
        public void setPublic_vise(String public_vise) {
            this.public_vise = public_vise;
        }
     
        public String getSociete() {
            return societe;
        }
     
        public void setSociete(String societe) {
            this.societe = societe;
        }
     
        public String getTranche_age() {
            return tranche_age;
        }
     
        public void setTranche_age(String tranche_age) {
            this.tranche_age = tranche_age;
        }
     
        public String getType_compagne() {
            return type_compagne;
        }
     
        public void setType_compagne(String type_compagne) {
            this.type_compagne = type_compagne;
        }
     
        public String getType_invest() {
            return type_invest;
        }
     
        public void setType_invest(String type_invest) {
            this.type_invest = type_invest;
        }
     
        public String getCritere_ville() {
            return critere_ville;
        }
     
        public void setCritere_ville(String critere_ville) {
            this.critere_ville = critere_ville;
        }
     
         public String getHeader() {
            return header;
        }
     
        public void setHeader(String header) {
            this.header = header;
        }
     
        public String getTexte() {
            return texte;
        }
     
        public void setTexte(String texte) {
            this.texte = texte;
        }
     
     
    }
    and i have no errors

  2. #2
    Membre actif
    Profil pro
    Inscrit en
    Avril 2013
    Messages
    93
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2013
    Messages : 93
    Par défaut
    En faisant une sortie console, est ce que tu rentre dans ta méthode ?

  3. #3
    Membre éclairé
    Homme Profil pro
    Inscrit en
    Mai 2011
    Messages
    790
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations forums :
    Inscription : Mai 2011
    Messages : 790
    Par défaut
    on peut voir ce que ta console a affiché s'il vous plait?

  4. #4
    Membre confirmé
    Femme Profil pro
    Inscrit en
    Mai 2011
    Messages
    177
    Détails du profil
    Informations personnelles :
    Sexe : Femme

    Informations forums :
    Inscription : Mai 2011
    Messages : 177
    Par défaut
    bonjour,

    voici les résultats de la console
    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
     
     
     
    WARNING: PWC4011: Unable to set request character encoding to UTF-8 from context /WebApplication1, because request parameters have already been read, or ServletRequest.getReader() has already been called
    WARNING: #{nouvelleCompagne.addCompagne(name, description, texte, header, budget, nbre)}: javax.el.MethodNotFoundException: /petitPanel.xhtml @111,149 action="#{nouvelleCompagne.addCompagne(name, description, texte, header, budget, nbre)}": Method addCompagne not found
    javax.faces.FacesException: #{nouvelleCompagne.addCompagne(name, description, texte, header, budget, nbre)}: javax.el.MethodNotFoundException: /petitPanel.xhtml @111,149 action="#{nouvelleCompagne.addCompagne(name, description, texte, header, budget, nbre)}": Method addCompagne not found
    	at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:110)
    	at javax.faces.component.UICommand.broadcast(UICommand.java:315)
    	at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
    	at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
    	at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
    	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    	at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
    	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
    	at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1539)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
    	at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
    	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
    	at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
    	at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
    	at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:330)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
    	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:174)
    	at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
    	at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
    	at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
    	at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
    	at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
    	at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
    	at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
    	at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
    	at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
    	at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
    	at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
    	at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
    	at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
    	at java.lang.Thread.run(Thread.java:722)
    Caused by: javax.faces.el.MethodNotFoundException: javax.el.MethodNotFoundException: /petitPanel.xhtml @111,149 action="#{nouvelleCompagne.addCompagne(name, description, texte, header, budget, nbre)}": Method addCompagne not found
    	at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:92)
    	at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
    	... 37 more
    Caused by: javax.el.MethodNotFoundException: /petitPanel.xhtml @111,149 action="#{nouvelleCompagne.addCompagne(name, description, texte, header, budget, nbre)}": Method addCompagne not found
    	at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:109)
    	at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
    	... 38 more

    comme vous le voyez déjà "methode addCompagne" not found.pourtant si j'appuis sur la touche Ctrl+ click sur la methode il me dirige directement à la methode addCompagne() qui se trouve dans la class NouvelleCompagne.

    c'est quoi le problème.je suis vraiment bloqué là

  5. #5
    Membre actif
    Profil pro
    Inscrit en
    Avril 2013
    Messages
    93
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2013
    Messages : 93
    Par défaut
    Alors si rien n'est envoyé c'est normal : Il te manque la balise h:form

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
        <h:body>
     
            <h:form>
     
                <p:panel header="General"> 
     
    ....
     
                <p:commandButton value="save" action="#{nouvelleCompagne.addCompagne}" />
            </h:form>
    Ensuite donne un nom a ton bean

    @ManagedBean(name = "nouvelleCompagne")

    Et enfin tu utilise une méthode type JSF :

    public String AddCompagne() {
    // Recupération des données du bean
    return "";
    }


    <p:commandButton value="save" action="#{nouvelleCompagne.addCompagne}" />

  6. #6
    Membre confirmé
    Femme Profil pro
    Inscrit en
    Mai 2011
    Messages
    177
    Détails du profil
    Informations personnelles :
    Sexe : Femme

    Informations forums :
    Inscription : Mai 2011
    Messages : 177
    Par défaut
    merci bien pour votre réponse cryo94 mais ça ne résout pas le problème.j'ai toujours le meme affichage dans ma console comme s'il ne reconnait pas ma methode et toujours pas de sauvegarde dans ma base de donnée

    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
     
     
     
    WARNING: PWC4011: Unable to set request character encoding to UTF-8 from context /WebApplication1, because request parameters have already been read, or ServletRequest.getReader() has already been called
    WARNING: #{nouvelleCompagne.addCompagne(name, description, texte, header, budget, nbre)}: javax.el.MethodNotFoundException: /petitPanel.xhtml @111,149 action="#{nouvelleCompagne.addCompagne(name, description, texte, header, budget, nbre)}": Method addCompagne not found
    javax.faces.FacesException: #{nouvelleCompagne.addCompagne(name, description, texte, header, budget, nbre)}: javax.el.MethodNotFoundException: /petitPanel.xhtml @111,149 action="#{nouvelleCompagne.addCompagne(name, description, texte, header, budget, nbre)}": Method addCompagne not found
    	at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:110)
    	at javax.faces.component.UICommand.broadcast(UICommand.java:315)
    	at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
    	at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
    	at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
    	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    	at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
    	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
    	at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1539)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
    	at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
    	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
    	at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
    	at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
    	at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:330)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
    	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:174)
    	at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
    	at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
    	at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
    	at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
    	at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
    	at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
    	at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
    	at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
    	at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
    	at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
    	at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
    	at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
    	at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
    	at java.lang.Thread.run(Thread.java:722)
    Caused by: javax.faces.el.MethodNotFoundException: javax.el.MethodNotFoundException: /petitPanel.xhtml @111,149 action="#{nouvelleCompagne.addCompagne(name, description, texte, header, budget, nbre)}": Method addCompagne not found
    	at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:92)
    	at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
    	... 37 more
    Caused by: javax.el.MethodNotFoundException: /petitPanel.xhtml @111,149 action="#{nouvelleCompagne.addCompagne(name, description, texte, header, budget, nbre)}": Method addCompagne not found
    	at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:109)
    	at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
    	... 38 more

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

Discussions similaires

  1. Comment utilisté un servlet avec un formulaire jsf?
    Par lakhdharani dans le forum JSF
    Réponses: 2
    Dernier message: 18/02/2009, 11h10
  2. Réponses: 2
    Dernier message: 28/01/2009, 18h05
  3. Sauvegarde contenu formulaire JSF dans la BDD
    Par viscere dans le forum JSF
    Réponses: 2
    Dernier message: 02/10/2008, 10h28
  4. Mise à jour avec formulaire jsf
    Par intissar_g dans le forum JSF
    Réponses: 6
    Dernier message: 25/08/2008, 08h32
  5. [MySQL] formulaire html avec sauvegarde des données
    Par orke22 dans le forum PHP & Base de données
    Réponses: 4
    Dernier message: 23/04/2008, 19h55

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