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

Servlets/JSP Java Discussion :

The class 'modele.Module' does not have the property 'nom_module'.


Sujet :

Servlets/JSP Java

  1. #1
    Membre du Club
    Homme Profil pro
    Assistant aux utilisateurs
    Inscrit en
    Janvier 2018
    Messages
    299
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 28
    Localisation : France, Seine Maritime (Haute Normandie)

    Informations professionnelles :
    Activité : Assistant aux utilisateurs
    Secteur : Distribution

    Informations forums :
    Inscription : Janvier 2018
    Messages : 299
    Points : 67
    Points
    67
    Par défaut The class 'modele.Module' does not have the property 'nom_module'.
    Hello!

    Sous un serveur Wildfly, j'ai l'erreur suivante :
    Nom : lll.png
Affichages : 148
Taille : 57,0 Ko
    Les 2 fichiers concernés:
    Mon index.xhtml ( page côté client)
    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
    <!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:rich="http://richfaces.org/rich"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:a4j="http://richfaces.org/a4j"
          xmlns:h="http://java.sun.com/jsf/html"> 
     
    <h:head></h:head> 
    <body>
    <h:form>
       <rich:panel>
         <rich:dataTable id="tableModules" var="module" value="#{ApplicationBean.lesModules}">
            <rich:column>
              <f:facet name="header">
                 <h:outputText value="Code UE" />
              </f:facet>
              <h:outputText value="#{module.nom_module}" />
            </rich:column>
            <rich:column>
              <f:facet name="header">
                 <h:outputText value="Initulé UE" />
              </f:facet>
              <h:outputText value="#{module.intitule_module}" />
              </rich:column>
            <rich:column>
              <f:facet name="header">
                 <h:outputText value="Nb heures cours" />
              </f:facet>                         
              <h:outputText value="#{module.nb_heures_cours}" />
            </rich:column>
            <rich:column>
              <f:facet name="header">
                 <h:outputText value="Nb heures TD" />
              </f:facet>                         
              <h:outputText value="#{module.nb_heures_td}" />
            </rich:column>      
         </rich:dataTable>
         </rich:panel>
    </h:form>
    </body>
    </html>
    Module.java (class côté serveur)
    Code Java : 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
    package modele;
     
    import java.io.Serializable;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
     
    @Entity
    public class Module implements Serializable {
    	/**
             * 
             */
    	private static final long serialVersionUID = 1L;
    	@Id
    	@GeneratedValue (strategy=GenerationType.AUTO) 
    		private int id;
    		private String nom_module;
    		private String intitule_module;
    		private String nb_heures_cours;
    		private int nb_heures_td;
     
    		public Module() {
    		}
     
     
    		public Module(String nom_module, String intitule_module, String nb_heures_cours, int nb_heures_td) {
    			super();
    			this.nom_module = nom_module;
    			this.intitule_module = intitule_module;
    			this.nb_heures_cours = nb_heures_cours;
    			this.nb_heures_td = nb_heures_td;
    		}
     
    		public int getId() {
    			return id;
    		}
    		public String getNomModule() {
    			return nom_module;
    		}
    		public void setNomModule(String nom_module) {
    			this.nom_module = nom_module;
    		}
    		public String getIntituleModule() {
    			return intitule_module;
    		}
    		public void setIntituleModule(String intitule_module) {
    			this.intitule_module = intitule_module;
    		}
    		public String getNbHeuresCours() {
    			return nb_heures_cours;
    		}
    		public void setAdresse(String nb_heures_cours) {
    			this.nb_heures_cours = nb_heures_cours;
    		}
    		public int getNbHeuresTd() {
    			return nb_heures_td;
    		}
    		public void setNbHeuresTd(int nb_heures_td) {
    			this.nb_heures_td = nb_heures_td;
    		}
    	}

    Si vous voyez quelque chose qui cloche... merci d'avance

  2. #2
    Membre expérimenté Avatar de Cincinnatus
    Homme Profil pro
    Développeur d'applications métier
    Inscrit en
    Mars 2007
    Messages
    592
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Nord (Nord Pas de Calais)

    Informations professionnelles :
    Activité : Développeur d'applications métier
    Secteur : Service public

    Informations forums :
    Inscription : Mars 2007
    Messages : 592
    Points : 1 679
    Points
    1 679
    Par défaut
    Citation Envoyé par Zarkoffe Voir le message
    Si vous voyez quelque chose qui cloche... merci d'avance
    Simplement, JSF attend un 'nom_module' et la classe Module expose "nomModule" (cf getNomModule / setNomModule). Le nom du membre "nom_module" est indifférent à JSF, puisque seuls les accesseurs sont visibles de la page.

Discussions similaires

  1. Réponses: 3
    Dernier message: 06/12/2013, 13h03
  2. The component 'xyz' does not have a resource identified by the URI
    Par ptitshrek dans le forum Windows Presentation Foundation
    Réponses: 4
    Dernier message: 05/02/2010, 16h48
  3. Class does not have a main method
    Par chlock62 dans le forum NetBeans
    Réponses: 2
    Dernier message: 29/11/2009, 15h11
  4. Réponses: 3
    Dernier message: 23/05/2008, 15h26
  5. Réponses: 9
    Dernier message: 11/09/2007, 18h17

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