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 :

Erreur "javax.el.ELException: /default.xhtml: Property 'orderNo' not found on type com.datatable.Order"


Sujet :

JSF Java

  1. #1
    Futur Membre du Club
    Femme Profil pro
    Développeur informatique
    Inscrit en
    Juillet 2012
    Messages
    5
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France, Creuse (Limousin)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juillet 2012
    Messages : 5
    Points : 6
    Points
    6
    Par défaut Erreur "javax.el.ELException: /default.xhtml: Property 'orderNo' not found on type com.datatable.Order"
    Bonjour,

    J'ai implémenté un petit exemple de JSF.

    J'utilise les jar de jsf-api, jsf-impl pour la version 2.1.7 + JSTL 1.2.

    Lors de l'exécution de la page il donne ce message :
    GRAVE: Error Rendering View[/default.xhtml]
    javax.el.ELException: /default.xhtml: Property 'orderNo' not found on type com.datatable.Order
    at com.sun.faces.facelets.compiler.TextInstruction.write(TextInstruction.java:85)
    at com.sun.faces.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:78)
    at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:298)
    at com.sun.faces.renderkit.html_basic.TableRenderer.renderRow(TableRenderer.java:376)
    at com.sun.faces.renderkit.html_basic.TableRenderer.encodeChildren(TableRenderer.java:157)
    at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:849)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1663)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1666)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1666)
    at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:389)
    at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:127)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:117)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:135)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:335)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Unknown Source)
    Voici mon code
    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
    import java.io.Serializable;
    import java.math.BigDecimal;
    import javax.faces.bean.ManagedBean;
    import javax.faces.bean.SessionScoped;
     
    @ManagedBean(name="order")
    @SessionScoped
    public class OrderBean implements Serializable{
     
        private static final long serialVersionUID = 1L;
     
        private static final Order[] orderList = new Order[] {
     
            new Order("A0001", "Intel CPU", 
                    new BigDecimal("700.00"), 1),
            new Order("A0002", "Harddisk 10TB", 
                    new BigDecimal("500.00"), 2),
            new Order("A0003", "Dell Laptop", 
                    new BigDecimal("11600.00"), 8),
            new Order("A0004", "Samsung LCD", 
                    new BigDecimal("5200.00"), 3),
            new Order("A0005", "A4Tech Mouse", 
                    new BigDecimal("100.00"), 10)
        };
     
        public Order[] getOrderList() {
     
            return orderList;
        }
    }
    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
    import java.math.BigDecimal;
     
    public class Order {
     
        String orderNo;
        String productName;
        BigDecimal price;
        int qty;
     
        public Order(String orderNo, String productName, BigDecimal price, int qty) {
            this.orderNo = orderNo;
            this.productName = productName;
            this.price = price;
            this.qty = qty;
        }
     
        //getter and setter methods
    }
    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
    <?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"
          >
        <h:head>
            <h:outputStylesheet library="css" name="table-style.css"  />
        </h:head>
        <h:body>
     
            <h1>JSF 2 dataTable example</h1>
     
                <h:dataTable value="#{order.orderList}" var="o"
                    styleClass="order-table"
                    headerClass="order-table-header"
                    rowClasses="order-table-odd-row,order-table-even-row"
                >
     
                    <h:column>
                        <!-- column header -->
                        <f:facet name="header">Order No</f:facet>
                        <!-- row record -->
                        #{o.orderNo}
                    </h:column>
     
                    <h:column>
                        <f:facet name="header">Product Name</f:facet>
                        #{o.productName}
                    </h:column>
     
                    <h:column>
                        <f:facet name="header">Price</f:facet>
                        #{o.price}
                    </h:column>
     
                    <h:column>
                        <f:facet name="header">Quantity</f:facet>
                        #{o.qty}
                    </h:column>
     
                </h:dataTable>
     
        </h:body>
    </html>
    Quelqu'un saurait-il m'indiquer d'où peut venir le problème ?

    Merci d'avance pour votre aide.

  2. #2
    Membre expérimenté
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2004
    Messages
    1 184
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Avril 2004
    Messages : 1 184
    Points : 1 745
    Points
    1 745
    Par défaut
    Poste le code complet de Order avec les getter et setters.

  3. #3
    Futur Membre du Club
    Femme Profil pro
    Développeur informatique
    Inscrit en
    Juillet 2012
    Messages
    5
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France, Creuse (Limousin)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juillet 2012
    Messages : 5
    Points : 6
    Points
    6
    Par défaut
    Merci beaucoup Mathieu, j'ai compris mon erreur.

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

Discussions similaires

  1. Property 'onAjoutProjetButton' not found on type
    Par SuperMicke34 dans le forum JSF
    Réponses: 2
    Dernier message: 27/11/2013, 10h47
  2. Property not found on type
    Par barmic dans le forum JSF
    Réponses: 11
    Dernier message: 10/12/2010, 13h53
  3. Property 'firstResult' not found
    Par CinePhil dans le forum Persistance des données
    Réponses: 1
    Dernier message: 25/11/2010, 17h09
  4. Réponses: 2
    Dernier message: 19/02/2010, 16h55
  5. Réponses: 1
    Dernier message: 22/01/2009, 18h36

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