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

Spring Java Discussion :

Erreur lors de la création du bean DataSource


Sujet :

Spring Java

  1. #21
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Décembre 2008
    Messages
    110
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2008
    Messages : 110
    Points : 35
    Points
    35
    Par défaut
    Bonjour

    Oui je sais que le 404 est un problème de redirection. Pouvez vous me débloquer pour que ça me redirige vers ma vue ?

    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
     
     
    <servlet>
      <servlet-name>Faces Servlet</servlet-name>
      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
      <load-on-startup>1</load-on-startup>
     </servlet>
     <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>*.jsf</url-pattern>
     </servlet-mapping>
     <session-config>
      <session-timeout>30</session-timeout>
     </session-config>
     <welcome-file-list>
      <welcome-file>DepartementList.xhtml</welcome-file>
     </welcome-file-list>
    </web-app>
    J'ai fait ça mais ça ne passe pas.

    Merci d'avance pour votre aide.

  2. #22
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 481
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 481
    Points : 48 806
    Points
    48 806
    Par défaut
    Commence déjà par regarder quelle est l'url complète pour accéder à ton DepartmentList (ça je peux pas la deviner moi, j'ai pas ton projet). Ensuite, une fois que tu l'a, tu peux la mettre comme welcome file.

  3. #23
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Décembre 2008
    Messages
    110
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2008
    Messages : 110
    Points : 35
    Points
    35
    Par défaut
    Normalement c'est DepartementList.jsp. Je l'ai fais mais ça ne passe. J'ai toujours le 404.
    Images attachées Images attachées  

  4. #24
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 481
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 481
    Points : 48 806
    Points
    48 806
    Par défaut
    tu tappe bien

    http://localhost:8080/GestionClientsDepart/DepartmentList.jsp


    ??

  5. #25
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Décembre 2008
    Messages
    110
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2008
    Messages : 110
    Points : 35
    Points
    35
    Par défaut
    J'ai fais une URL complète ça ne passe pas. Normalement, je mentionnais le nom de la vue dans Netbeans comme ceci :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
     
     
        <servlet-mapping>
            <servlet-name>Faces Servlet</servlet-name>
            <url-pattern>/faces/*</url-pattern>
        </servlet-mapping>
     
     
     
     
        <welcome-file-list>
            <welcome-file>faces/indexx2.xhtml</welcome-file>
        </welcome-file-list>

  6. #26
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 481
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 481
    Points : 48 806
    Points
    48 806
    Par défaut
    Citation Envoyé par othman22222 Voir le message
    J'ai fais une URL complète ça ne passe pas.
    Tu veux dire que tu tappe

    http://localhost:8080/GestionClients...rtmentList.jsp

    dans ton browser et que t'as toujours un ressource non trouvée?

  7. #27
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Décembre 2008
    Messages
    110
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2008
    Messages : 110
    Points : 35
    Points
    35
    Par défaut
    J'ai résolu le problème. J'en ai un autre pour l'affichage de la datatable.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    org.apache.jasper.JasperException: java.lang.RuntimeException: Cannot find FacesContext
    	org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:549)
    	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:470)
    	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
     
     
    cause mère
    Le 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
     
     
     
     
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>
        <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
         <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
     
     
     
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
     
     
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Liste des Departement</title>
    </head>
    <body>
     
     
     
          <h:dataTable value="#{DepartementBean.departementList}" var="item" >
     
     
     
     
        <h:column>
     
     
                            <f:facet name="header">
                                <h:outputText value="Numero Departement"/>
                            </f:facet>
     
     
                                <h:outputText style="text-align:center" value="#{item.numero}"/>
     
                        </h:column>
     
     
     
     
                        <h:column>
     
                            <f:facet name="header">
                                <h:outputText value="Libelle"/>
                            </f:facet>
                                <h:outputText style="text-align:center" value="#{item.nom}"/>
     
                        </h:column>
     
     
     
     
                    </h:dataTable>
     
     
     
     
     
     
    </body>
    </html>
    Je crois que j'ai un problème dans mon managedBean.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
     
     
     
     
     
    	private List<Depatement> departementList ;
     
    	public void init()
     
     
    	{
    		departementList= departementservice.findAll() ;
     
    	}

  8. #28
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 481
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 481
    Points : 48 806
    Points
    48 806
    Par défaut
    jaio résolu le blém
    ok on avance


    org.apache.jasper.JasperException: java.lang.RuntimeException: Cannot find FacesContext
    Ca veux dire qu'il n'y a pas de contexte JSF, autrement dit que tu as accédé à la jsp directement plutot que de passer par la servlet JSF. Vu que ton web.xml contient
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>*.jsf</url-pattern>
     </servlet-mapping>
    tu as juste à remplacer .jsp par .jsf dans ton url dans le browser et ce sera réglé.

  9. #29
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Décembre 2008
    Messages
    110
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2008
    Messages : 110
    Points : 35
    Points
    35
    Par défaut
    Bonjour,

    J'ai déjà essayé avant que vous m'avez proposer mais ça ne passe pas. Voilà la dernière version du web.xml :
    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"?>
    <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
     <context-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>classpath:application-context.xml</param-value>
     </context-param>
     <context-param>
      <param-name>javax.faces.CONFIG_FILES</param-name>
      <param-value>/WEB-INF/faces-config.xml</param-value>
     </context-param>
     <context-param>
      <param-name>javax.faces.PROJECT_STAGE</param-name>
      <param-value>production</param-value>
     </context-param>
     <listener>
      <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
     </listener>
     <listener>
      <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
     </listener>
     <servlet>
      <servlet-name>Faces Servlet</servlet-name>
      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
      <load-on-startup>1</load-on-startup>
     </servlet>
     <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>*.jsf</url-pattern>
     </servlet-mapping>
     
     
     
     
     
      <welcome-file-list>
      <welcome-file>DepartementList.jsp</welcome-file>
     </welcome-file-list>
     
     
     <session-config>
      <session-timeout>30</session-timeout>
     </session-config>
     
    </web-app>
    Images attachées Images attachées  

  10. #30
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 481
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 481
    Points : 48 806
    Points
    48 806
    Par défaut
    Citation Envoyé par othman22222 Voir le message
    Bonjour,


    j'ai déja essayer avant que vous m'avez proposer mais ca passe pas
    T'es sur? Parce que c'est toujours .jsp et pas .jsf que je vois là:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
      <welcome-file-list>
      <welcome-file>DepartementList.jsp</welcome-file>
     </welcome-file-list>

  11. #31
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Décembre 2008
    Messages
    110
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2008
    Messages : 110
    Points : 35
    Points
    35
    Par défaut
    Le problème n'est pas dans la welcomelist mais dans faceservlet. Je ne sais pas ce que je dois mettre pour que ça passe.

  12. #32
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 481
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 481
    Points : 48 806
    Points
    48 806
    Par défaut
    ta capture d'écran, elle correspond à quelle url? Puisqu'on a pas l'url dans la capture.

    Normalement, si ton url fini par .jsf, ça passer par la servlet JSF vu ton mapping.

  13. #33
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Décembre 2008
    Messages
    110
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2008
    Messages : 110
    Points : 35
    Points
    35
    Par défaut
    Voici le fichier web.xml :
    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
     
     
     
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
     <context-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>classpath:application-context.xml</param-value>
     </context-param>
     <context-param>
      <param-name>javax.faces.CONFIG_FILES</param-name>
      <param-value>/WEB-INF/faces-config.xml</param-value>
     </context-param>
     <context-param>
      <param-name>javax.faces.PROJECT_STAGE</param-name>
      <param-value>production</param-value>
     </context-param>
     <listener>
      <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
     </listener>
     <listener>
      <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
     </listener>
     <servlet>
      <servlet-name>Faces Servlet</servlet-name>
      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
      <load-on-startup>1</load-on-startup>
     </servlet>
     <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>*.jsf</url-pattern>
     </servlet-mapping>
     
     
     
     
     
      <welcome-file-list>
      <welcome-file>DepartementList.jsf</welcome-file>
     </welcome-file-list>
     
     
     <session-config>
      <session-timeout>30</session-timeout>
     </session-config>
     
    </web-app>
    Images attachées Images attachées  

  14. #34
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Décembre 2008
    Messages
    110
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2008
    Messages : 110
    Points : 35
    Points
    35
    Par défaut
    J'ai résolu mon problème mais l'affichage des données est vide.
    Images attachées Images attachées  

  15. #35
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 481
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 481
    Points : 48 806
    Points
    48 806
    Par défaut
    Ok, on progresse

    Maintent, il te faut faire du pas à pas dans ton bean pour savoir pourquoi sa méthode findAll retourne une liste vide

  16. #36
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Décembre 2008
    Messages
    110
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2008
    Messages : 110
    Points : 35
    Points
    35
    Par défaut
    Bonjour ,

    normalement jai fais le test unitaire de ma méthode findAll ca passe bien et les
    informations saffiche mon problém je crois cc'est au niveau de mon managedBean



    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
     
     
    package com.gestion.managedBean;
     
    import java.io.Serializable;
     
    import org.springframework.context.annotation.Scope;
    import org.springframework.stereotype.Component;
    import java.util.List;
     
     
    import com.gestion.model.Depatement;
    import com.gestion.service.DepartementService;
     
     
    @Component("DepartementBean")
    @Scope("session")
    public class DepartementBean implements  Serializable {
     
    	private transient DepartementService departementservice;
     
     
    	private List<Depatement> departementList ;
     
    	public void init()
     
     
    	{
    		departementList= departementservice.findAll() ;
     
    	}
     
     
     
     
     
       public List <Depatement> getDepartements() 
      {  
     
          return departementservice.findAll() ;
      }  
     
     
     
     
    	public DepartementService getDepartementservice() {
    		return departementservice;
    	}
     
     
    	public void setDepartementservice(DepartementService departementservice) {
    		this.departementservice = departementservice;
    	}
     
     
    	public List<Depatement> getDepartementList() {
    		return departementList;
    	}
     
     
    	public void setDepartementList(List<Depatement> departementList) {
    		this.departementList = departementList;
    	}
     
     
     
    	}



    ma vue


    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"%>
        <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
         <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
     
     
     
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
     
    <f:view>
     
    <html>
    <head>
     
     
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Liste des Departement</title>
    </head>
    <body>
     
     
          <h:dataTable value="#{DepartementBean.departementList}" var="item" >
     
     
     
     
        <h:column>
     
     
                            <f:facet name="header">
                                <h:outputText value="Numero Departement"/>
                            </f:facet>
     
     
                                <h:outputText style="text-align:center" value="#{item.numero}"/>
     
                        </h:column>
     
     
     
     
                        <h:column>
     
                            <f:facet name="header">
                                <h:outputText value="Libelle"/>
                            </f:facet>
                                <h:outputText style="text-align:center" value="#{item.nom}"/>
     
                        </h:column>
     
     
     
     
                    </h:dataTable>
     
     
     
    </body>
    </html>
     
    </f:view>
    Images attachées Images attachées   

  17. #37
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 481
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 481
    Points : 48 806
    Points
    48 806
    Par défaut
    le test unitaire ne te dispence pas d'aller voir ce qui sort de findAll dans le serveur. Il peux y avoir de multiple raisons pas pensées dans le test unitaire qui font que ça foire. La base de données peut être différente dans la production par exemple.

  18. #38
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Décembre 2008
    Messages
    110
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2008
    Messages : 110
    Points : 35
    Points
    35
    Par défaut
    oui vous avez raison


    voila la méthode dans hibernate



    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
     
     
     
    package com.gestion.service;
     
    import java.util.List;
     
    import org.hibernate.SessionFactory;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.core.io.ClassPathResource;
    import org.springframework.orm.hibernate3.AbstractSessionFactoryBean;
    import org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean;
    import org.springframework.stereotype.Service;
    import org.springframework.transaction.annotation.Transactional;
     
    import com.gestion.model.Depatement;
     
     
    @Service("DepartementService")
    @Transactional
    public class DepartementServiceImpl implements DepartementService {
     
    	@Autowired
    	private SessionFactory sessionFactory;
     
     
     
     
     
    	public SessionFactory getSessionFactory() {
    		return sessionFactory;
    	}
     
     
    	public void setSessionFactory(SessionFactory sessionFactory) {
    		this.sessionFactory = sessionFactory;
    	}
     
     
    	@Override
    	@SuppressWarnings("unchecked")
    	public List<Depatement> findAll() {
    		// TODO Auto-generated method stub
    		return sessionFactory.getCurrentSession().createQuery("SELECT d FROM Depatement d").list();
    	}
     
     
    	@Override
        public Depatement findById(Integer id) {
    		// TODO Auto-generated method stub
    		return  (Depatement) sessionFactory.getCurrentSession().get(Depatement.class, id);
    	}
     
     
    	@Override
    	public void save(Depatement departement) {
    		sessionFactory.getCurrentSession().saveOrUpdate(departement);
     
    	}
     
    }


    je sais pas pk les données saffiche pas

  19. #39
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 481
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 481
    Points : 48 806
    Points
    48 806
    Par défaut
    Heu ma question était: quand tu fait du debug sur le serveur: qu'est-ce que findAll retourne? Qu'on sache si
    1) findall est bien appelé
    2) findall retourne bien une liste et non vide
    3) si jsf traite bien la liste par après.

  20. #40
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Décembre 2008
    Messages
    110
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2008
    Messages : 110
    Points : 35
    Points
    35
    Par défaut
    findall il est bien appelé.

    Oui il retourne bien une liste et non vide. Mais ça ne s'affiche pas dans la datatable je sais pas pourquoi j'ai cherché partout. Un truc sur le managedBean je crois dans la méthide init qui passe pas.

Discussions similaires

  1. Erreur lors de la création d'un Bean
    Par ezequielfranck dans le forum Frameworks Web
    Réponses: 1
    Dernier message: 24/11/2012, 19h55
  2. Réponses: 4
    Dernier message: 21/02/2006, 16h47
  3. Réponses: 1
    Dernier message: 26/05/2005, 12h24
  4. message d'erreur lors de la création de la base
    Par ber_jp dans le forum PostgreSQL
    Réponses: 3
    Dernier message: 20/05/2004, 12h15
  5. message d'erreur lors de la création d'une base
    Par franculo_caoulene dans le forum MS SQL Server
    Réponses: 4
    Dernier message: 16/04/2004, 15h47

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