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 :

Cannot create session after response has been committed


Sujet :

JSF Java

  1. #1
    Candidat au Club
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juillet 2017
    Messages
    3
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 30
    Localisation : Tunisie

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

    Informations forums :
    Inscription : Juillet 2017
    Messages : 3
    Points : 2
    Points
    2
    Par défaut Cannot create session after response has been committed
    Bonjour à tous ,

    Comme mon titre l'indique j'ai cette erreur.
    J'aimerai savoir si c'est "normal" (mauvaise utilisation de JSF) et si il y a une explication a ce phénomène que je qualifierai d'étrange

    Pour information, j'utilise glassfish 3.1 et openJDK 1.7

    J'explique la procédure pour le reproduire :
    1) Créer la page suivante exercice.xhtml :
    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
    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
    <?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:ui="http://java.sun.com/jsf/facelets"
          xmlns:p="http://primefaces.org/ui"
          xmlns:b="http://bootsfaces.net/ui"
          xmlns:f="http://java.sun.com/jsf/core">
        <body>
            <ui:composition template="/menubar/top.xhtml">
                <ui:define name="title">
                    Exercice
                </ui:define>
                <ui:define name="content">
                    <h:form>
     
                        <p:growl life="5000" autoUpdate="true"/>
                        <b:well>
                            <b:row styleClass="show-grid" style="color: black;">
                                <b:column  span="3">
                                    <b:panel title="Liste des sociétés ()" collapsible="false" >    
     
                                        <b:dataTable value="" page-length-menu="[5,10,15,20,25,30,35,40,50,60,70,100]" lang="fr" style="margin-top: 4px;" >
                                            <b:dataTableColumn style="width: 30px;" label="">                                   
                                                <b:commandButton value=""  title="Sélectionner" icon="glyphicon glyphicon-share-alt"/>
                                            </b:dataTableColumn>
                                            <b:dataTableColumn label="Code société" value=""/>
                                            <b:dataTableColumn label="Nom société" style="text-align: right"/>
     
                                        </b:dataTable>
                                    </b:panel>
                                </b:column>
     
                                <b:column span="9">
                                    <b:panel title="Société : " collapsible="false" >    
                                        <b:panel>
                                            <b:row>
     
                                                <b:column span="6">
                                                    <h:outputText class="titre" value="Code Société : "/> <br></br>
                                                    <h:outputText class="titre" value="Nom de la société : "/><br></br>
                                                    <h:outputText class="titre" value="Adresse :" />
                                                    <h:outputText class="titre" value="Activité :" />
                                                </b:column>
     
     
     
                                            </b:row>
                                        </b:panel>
     
                                        <b:row styleClass="show-grid">
                                            <b:column span="3">
                                                <b:panel  title="Exercice" style="100%" collapsible="false"> 
                                                    <h:outputLabel value="Code exercice :"></h:outputLabel>
                                                    <b:inputText value=""></b:inputText>
                                                    <h:outputLabel value="Nom exercice :"></h:outputLabel>
                                                    <b:inputText value=""></b:inputText>
     
                                                    <h:outputLabel value="Date de début :" ></h:outputLabel>
                                                    <b:inputText value=""></b:inputText>
                                                    <h:outputLabel value="Date de fin :" ></h:outputLabel>
                                                    <b:inputText value=""></b:inputText>
     
                                                    <h:outputLabel value="Commentaire :"></h:outputLabel>
                                                    <b:inputText value=""></b:inputText>
     
                                                    <p:commandButton style="margin: 2px;" title="Ajouter/Editer" icon="ui-icon-disk"/> 
                                                    <p:commandButton id="grow" title="Annuler" style="margin: 2px;" icon="ui-icon-circle-close"/>
                                                    <p:commandButton  style="margin: 2px;margin-left: 40px" title="Supprimer" icon="ui-icon-circle-minus">
                                                        <p:confirm header="Confirmation" message="Êtes-vous sûr de vouloir supprimer cet  ?" icon="ui-icon-alert" />
                                                    </p:commandButton>
                                                    <p:dialog modal="true" widgetVar="dialogSupprimCompta" header="Validation de la suppression :" showEffect="fade" hideEffect="fade">
                                                        <p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
                                                            <center>
                                                                <p:commandButton value="Oui"  type="button" styleClass="ui-confirmdialog-yes"/>
                                                                <p:commandButton value="Non"  type="button" styleClass="ui-confirmdialog-no"/>
                                                            </center>
                                                        </p:confirmDialog>
                                                    </p:dialog>
                                                </b:panel> 
                                            </b:column>
                                            <b:column  span="9"  style="padding-right: 30px; " >
                                                <b:panel title="Liste des exercices " style="100%" collapsible="false">    
     
                                                    <b:dataTable value="" page-length-menu="[5,10,15,20,25,30,35,40,50,60,70,100]" lang="fr" >
     
                                                        <b:dataTableColumn label="" style="text-align: center;">
                                                            <b:commandButton value="" title="Sélectionner" icon="glyphicon glyphicon-triangle-left"/>
                                                        </b:dataTableColumn>
     
                                                        <b:dataTableColumn label="Code exercice" value="" style="width:  120px"></b:dataTableColumn>
                                                        <b:dataTableColumn label="Nom exercice" value="" style="width:  120px"></b:dataTableColumn>
                                                        <b:dataTableColumn label="Date début" value="" style="width:  120px"></b:dataTableColumn>
                                                        <b:dataTableColumn label="Date fin" value="" style="width:  120px"></b:dataTableColumn>
     
                                                        <b:dataTableColumn label="Commentaire" value=""></b:dataTableColumn>
                                                    </b:dataTable>
                                                </b:panel>
                                            </b:column>    
                                        </b:row>
                                    </b:panel>
                                </b:column>
                            </b:row>
                        </b:well>
                    </h:form>
                </ui:define>
            </ui:composition>
        </body>
    </html>
    Si vous pouvez m'aider, je serai très intéressé.

  2. #2
    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 as un bout de code dans tes beans, que tu appelle lors du rendu, et qui tente de créer un session. Seulement pendant la phase de rendu, c'est trop tard.

  3. #3
    Candidat au Club
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juillet 2017
    Messages
    3
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 30
    Localisation : Tunisie

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

    Informations forums :
    Inscription : Juillet 2017
    Messages : 3
    Points : 2
    Points
    2
    Par défaut
    Bonjour à tous !
    Mais j'ai pas encore développer mes beans !

  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
    Ha désolé je pensais que tu avaios édité les value avant de poster.

    Il y a quoi dans ton web-inf/lib?
    tu as quoi comme classes et ton web.xml ressemble à quoi?

  5. #5
    Candidat au Club
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juillet 2017
    Messages
    3
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 30
    Localisation : Tunisie

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

    Informations forums :
    Inscription : Juillet 2017
    Messages : 3
    Points : 2
    Points
    2
    Par défaut Même problème :(
    Nom : web-inf.PNG
Affichages : 235
Taille : 5,2 Ko
    Nom : web.PNG
Affichages : 226
Taille : 28,6 Ko
    Merci de m'aider

Discussions similaires

  1. Réponses: 5
    Dernier message: 20/12/2011, 18h00
  2. Erreur "Cannot create a session after the response has been committed"
    Par aurelientp dans le forum Développement Web en Java
    Réponses: 0
    Dernier message: 07/12/2011, 11h14
  3. Réponses: 0
    Dernier message: 06/05/2011, 10h56
  4. Réponses: 2
    Dernier message: 09/10/2010, 17h10
  5. [JSP]Cannot forward after response has been committed
    Par hinanui dans le forum Servlets/JSP
    Réponses: 9
    Dernier message: 03/02/2007, 03h11

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