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 :

[PrimeFaces] Pas d'affichage


Sujet :

JSF Java

  1. #1
    Futur Membre du Club
    Homme Profil pro
    Inscrit en
    Janvier 2013
    Messages
    8
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Janvier 2013
    Messages : 8
    Points : 9
    Points
    9
    Par défaut [PrimeFaces] Pas d'affichage
    Bonjour à tous!

    Ayant changer toutes mes versions pour des plus récentes(eclipse primefaces glassfish) je ne parviens plus à afficher correctement mes pages
    je suis actuellement sous eclipse Luna, glassfish 4.1
    Primefaces 5.1 (jar qui est bien dans mon web-inf/lib)
    Résultat pour cette page basique -> Seul le bouton et les titres s'affichent mais pas les balises p


    Code html : 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
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html lang="fr"
    xmlns="http://www.w3.org/1999/xhtml"
    	xmlns:p="http://primefaces.org/ui"
    	xmlns:ui="http://java.sun.com/jsf/facelets"
    	xmlns:h="http://java.sun.com/jsf/html"
    	xmlns:f="http://java.sun.com/jsf/core"
    	xmlns:c="http://java.sun.com/jsp/jstl/core">
    <head>
    <title>Insert title here</title>
    </head>
     
    <body>
          <button type="button">Click Me!</button> 
     
    <form>	
    <h1 id= "tit" class="title ui-widget-header ui-corner-all">ACCUEIL  SIGNALEMENTS</h1>
    <p:button outcome="productDetail" value="Bookmark" icon="ui-icon-star">
        <f:param name="productId" value="10" />
    </p:button>
     
    <p:button outcome="productDetail" value="With Icon" icon="ui-icon-star">
        <f:param name="productId" value="20" />
    </p:button>
     
    <p:button outcome="productDetail" icon="ui-icon-star" title="Icon Only">
        <f:param name="productId" value="30" />
    </p:button>
     
    <p:button outcome="productDetail" value="Bookmark" icon="ui-icon-star" disabled="true">
        <f:param name="productId" value="40" />
    </p:button>
    </form>	
    </body>
    </html>

    J'ai retourné le problème dans tous les sens mais dans l'immédiat je sèche et vous remercie d'avance pour quelques probables pistes....

  2. #2
    Membre régulier
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Janvier 2015
    Messages
    87
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 35
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Janvier 2015
    Messages : 87
    Points : 117
    Points
    117
    Par défaut
    avec primefacess tu dois écrire <h:form> au lieux de <form> et <h:body> au lieux de <body>

  3. #3
    Futur Membre du Club
    Homme Profil pro
    Inscrit en
    Janvier 2013
    Messages
    8
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Janvier 2013
    Messages : 8
    Points : 9
    Points
    9
    Par défaut
    Affirmatif! mais ça ne change rien. Merci de me le souligner, je n'avais pas vu a force de tester divers solutions.
    Cette page n'a pas beaucoup d'intérêt mais devrait fonctionner ( avec les balises <h:form> et <h:body> ) .
    J'ai essayé sur une autre machine (32bits) la même configuration mais J'obtiens le même résultat.

  4. #4
    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 peux utiliser les h:body/h:form et nous montrer le code source de la page telle que le vois le browser? (bouton droit => view page source)

  5. #5
    Membre régulier
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Janvier 2015
    Messages
    87
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 35
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Janvier 2015
    Messages : 87
    Points : 117
    Points
    117
    Par défaut
    tu peux faire imp ecran de l'affichage svp

  6. #6
    Futur Membre du Club
    Homme Profil pro
    Inscrit en
    Janvier 2013
    Messages
    8
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Janvier 2013
    Messages : 8
    Points : 9
    Points
    9
    Par défaut
    Code html : 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
     
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html lang="fr"
    xmlns="http://www.w3.org/1999/xhtml"
    	xmlns:p="http://primefaces.org/ui"
    	xmlns:ui="http://java.sun.com/jsf/facelets"
    	xmlns:h="http://java.sun.com/jsf/html"
    	xmlns:f="http://java.sun.com/jsf/core"
    	xmlns:c="http://java.sun.com/jsp/jstl/core">
    <h:head>
    <title>Insert title here</title>
    </h:head>
     
    <h:body>
          <button type="button">Click Me!</button> 
     
    <h:form>	
    <h1 id= "tit" class="title ui-widget-header ui-corner-all">ACCUEIL  SIGNALEMENTS</h1>
    <p:button outcome="productDetail" value="Bookmark" icon="ui-icon-star">
        <f:param name="productId" value="10" />
    </p:button>
     
    <p:button outcome="productDetail" value="With Icon" icon="ui-icon-star">
        <f:param name="productId" value="20" />
    </p:button>
     
    <p:button outcome="productDetail" icon="ui-icon-star" title="Icon Only">
        <f:param name="productId" value="30" />
    </p:button>
     
    <p:button outcome="productDetail" value="Bookmark" icon="ui-icon-star" disabled="true">
        <f:param name="productId" value="40" />
    </p:button>
    </h:form>
    </h:body>
    </html>


    Merci pour votre retour!
    ci joint ce que j'obtiens dans mon navigateur....

    Nom : Sans titre-2.png
Affichages : 558
Taille : 79,5 Ko
    Images attachées Images attachées  

  7. #7
    Membre régulier
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Janvier 2015
    Messages
    87
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 35
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Janvier 2015
    Messages : 87
    Points : 117
    Points
    117
    Par défaut
    c'est normal qu'il n'affiche rien mon pote :

    - tout d'abord tu dois créer une page .xhtml et pas html
    - au lieux de <p:button> il y'a <p:commandButton value ="" OnClick ="" oncomplete= "" ...... /> et dois etre fermer à la fin comme il est indiqué
    et tu dois changer completement le corps de votre page pour etre adapté avec primefacess

    - visitez ça : http://www.primefaces.org/showcase/

    entête dois être comme ça par exemple :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
     
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <ui:composition 
    	xmlns="http://www.w3.org/1999/xhtml"
    	xmlns:h="http://java.sun.com/jsf/html"
    	xmlns:f="http://java.sun.com/jsf/core"
    	xmlns:p="http://primefaces.org/ui"
    	xmlns:ui="http://java.sun.com/jsf/facelets"
    	xmlns:c="http://java.sun.com/jsp/jstl/core">
    et à la fin
    et oublié l'ouverture et la fermeture de <html> et <body> je vois que c'est unutile

  8. #8
    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
    je vais quand même te contreduire un peu monta_amri

    La page est traditionnellement appelée .xhtml mais pas toujours.
    p:button existe bien dans show cas
    sa déclaration xhtml est correct, ui:composition n'est obligatoire que pour faire des fragment ou des templates.

    Ici, le problème est plus con. Rien n'est interprété car rien n'est passé par la servlet JSF. L'url du browser pointe directement vers le html source plutot que de pointer vers la servlet JSF. Dépendant de la configuration faite dans le web.xml, l'url correcte peut être

    http://localhost:8080/proj2/NewFile3.faces
    http://localhost:8080/proj2/NewFile3.xhtml
    http://localhost:8080/proj2/jsf/NewFile3.html
    http://localhost:8080/proj2/faces/NewFile3.html

    Bref, t'es occupé de demander un fichier statique au serveur web plutôt qu'un rendu jsf.

  9. #9
    Futur Membre du Club
    Homme Profil pro
    Inscrit en
    Janvier 2013
    Messages
    8
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Janvier 2013
    Messages : 8
    Points : 9
    Points
    9
    Par défaut
    Oui les boutons de ma page de test proviennent de http://www.primefaces.org/showcase/u...n/button.xhtml
    vos observations m’ont guidé vers les problèmes qui étaient dans le web.xml
    J'ai rajouté
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
      <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.xhtml</url-pattern>
      </servlet-mapping>
    pour l'extension xhtml mais le vrai problème c'était XHTML en majuscule voir ci dessous
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
       <context-param>
        <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
        <param-value>.XHTML</param-value>
      </context-param>
    la page fonctionne correctement
    Code html : 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
     
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html lang="fr"
    xmlns="http://www.w3.org/1999/xhtml"
    	xmlns:p="http://primefaces.org/ui"
    	xmlns:ui="http://java.sun.com/jsf/facelets"
    	xmlns:h="http://java.sun.com/jsf/html"
    	xmlns:f="http://java.sun.com/jsf/core"
    	xmlns:c="http://java.sun.com/jsp/jstl/core">
        <h:head>
            <title>Inscription</title>
        </h:head>
     <h:body>
          <h:form>
          <h1 id= "tit" class="title ui-widget-header ui-corner-all">ACCUEIL  SIGNALEMENTS</h1>
             <fieldset>
     
    		<p:button  value="Bookmark" icon="ui-icon-star">
        	<f:param name="productId" value="10" />
    		</p:button>
     
    	   	<p:button value="With Icon" icon="ui-icon-star">
    	    <f:param name="productId" value="20" />
    		</p:button>
     
    		<p:button  icon="ui-icon-star" title="Icon Only">
    	    <f:param name="productId" value="30" />
    		</p:button>    
     
              </fieldset>
          </h:form>   
     </h:body>   
    </html>

    Le fait d'avoir changer toute mes versions de dev (l'ancien Glassfish ne gérait pas les realm) m'ont mis le doute, notamment sur glassfish4.1 et l'implémentation des lib
    Merci pour votre aide, je vais pouvoir importer mon projet non finalisé

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

Discussions similaires

  1. sub My_Sub : pas d'affichage écran ?
    Par kafifi dans le forum Langage
    Réponses: 2
    Dernier message: 11/12/2005, 15h18
  2. pas d'affichage
    Par Bibouda dans le forum C
    Réponses: 3
    Dernier message: 08/11/2005, 08h44
  3. [TOMCAT][LOGS]pas d'affichage de trace dans la console
    Par fabszn dans le forum Tomcat et TomEE
    Réponses: 3
    Dernier message: 23/08/2005, 02h28
  4. [JTable] pas d'affichage du header
    Par I o dans le forum Composants
    Réponses: 2
    Dernier message: 27/04/2005, 13h42
  5. Pas d'affichage de texture sur certains PC
    Par octopus984 dans le forum GLUT
    Réponses: 7
    Dernier message: 19/04/2005, 13h22

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