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 :

jsf erreur : Conversion error occurred


Sujet :

JSF Java

  1. #1
    Membre averti
    Inscrit en
    Juillet 2010
    Messages
    11
    Détails du profil
    Informations forums :
    Inscription : Juillet 2010
    Messages : 11
    Par défaut jsf erreur : Conversion error occurred
    bonjour tout le monde

    j essaye de faire entrer mes données dans ma base en procédent par une interface jsp , mais la l 'erreur que j ai c est : Conversion error Occured

    la table a laquelle je fais entrer mes donnée contient comme attribut des varchar
    en ce qui concerne ma classe les attribut sont de type String.

    pour l appel depuis ma page jsp j fais comme suis

    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
     
    <tr>
    						      <td width="171" height="21" align="left" valign="top"><strong>Libellé Certificat</strong></td>
    						      <td width="3" align="left" valign="top"><strong>:</strong></td>
    						      <td align="left" valign="top">
    						      	<h:inputText id="libelleCertificat" value="#{CertificatVA.libelleCertificat}" styleClass="text_area1"/>
    						      </td>
    						    </tr>	
    						    <tr>
    						      <td width="171" height="21" align="left" valign="top"><strong>Abréviation</strong></td>
    						      <td width="3" align="left" valign="top"><strong>:</strong></td>
    						      <td align="left" valign="top">
    						      	<h:inputText id="abreviationCertificat" value="#{CertificatVA.abreviationCertificat}" styleClass="text_area1"/>
    						      </td>
    						    </tr>						    
    						</table>
    					    <table width="423">
    						    <tr>
    						      <td width="175">&nbsp;</td>
    						      <td width="66" align="left">
    						      	<h:commandButton   type ="submit" action="#{CertificatVA.ajouterCertificat}" value ="Valider" styleClass="button" />
    						      </td>
    pour ma classe CertificatVa elle est declarer comme suit:

    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
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
     
    package sis.ma.gima.referentiel.pl;
     
    import static javax.persistence.GenerationType.IDENTITY;
     
    import java.util.ArrayList;
    import java.util.Collection;
    import java.util.Date;
    import java.util.HashMap;
    import java.util.HashSet;
    import java.util.Iterator;
    import java.util.List;
    import java.util.Map;
    import java.util.Set;
     
    import javax.faces.context.FacesContext;
    import javax.faces.event.ValueChangeEvent;
    import javax.faces.model.SelectItem;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.Id;
    import javax.persistence.Table;
    import javax.servlet.http.HttpSession;
    import javax.swing.JSpinner.ListEditor;
     
    import org.hibernate.SessionFactory;
    import org.hibernate.Transaction;
    import org.hibernate.cfg.Configuration;
    import org.hibernate.classic.Session;
    import org.hibernate.*;
     
    import ma.co.deltasoft.summerframework.bll.BusinessResult;
    import ma.co.deltasoft.summerframework.bll.exception.BusinessActionFailedException;
    import ma.co.deltasoft.summerframework.bll.exception.BusinessLogicInitialisationException;
    import ma.co.deltasoft.summerframework.common.StartupException;
    import ma.co.deltasoft.summerframework.dal.IBusinessObjectManager;
    import ma.co.deltasoft.summerframework.dal.IBusinessObjectManagerFactory;
    import ma.co.deltasoft.summerframework.dal.IBusinessObjectTransaction;
    import ma.co.deltasoft.summerframework.dal.IPersistenceProvider;
    import ma.co.deltasoft.summerframework.dal.PersistenceProviderFactory;
    import ma.co.deltasoft.summerframework.dal.exception.DataAccessException;
    import ma.co.deltasoft.summerframework.pl.JsfViewAction;
    import sis.ma.gima.referentiel.model.Certificat;
    import sis.ma.gima.referentiel.utilitaire.*;
    import sis.ma.gima.referentiel.utilitaire.*;
     
    /*@Entity
    @Table(name = "certificat", catalog = "meryam")*/
    public class CertificatVA extends JsfViewAction implements java.io.Serializable
    {
     
     
    	/**
             * 
             */
    	private static final long serialVersionUID = 1L;
    	private int idCertificat;
    	private String libelleCertificat;
    	private String abreviationCertificat;
    	private Set rh = new HashSet();
     
    	public CertificatVA()
    	{
     
    	}
    	public CertificatVA(String libelleCertificat, String abreviationCertificat )
    	{
    		this.libelleCertificat = libelleCertificat;
    		this.abreviationCertificat = abreviationCertificat;
    	}
     
    	public int getIdCertificat() {
    		return idCertificat;
    	}
     
    	public void setIdCertificat(int idCertificat) {
    		this.idCertificat = idCertificat;
    	}
     
     
    	public String getLibelleCertificat() {
    		return libelleCertificat;
    	}
     
    	public void setLibelleCertificat(String libelleCertificat) {
    		this.libelleCertificat = libelleCertificat;
    	}
     
     
    	public String getAbreviationCertificat() {
    		return abreviationCertificat;
    	}
     
    	public void setAbreviationCertificat(String abreviationCertificat) {
    		this.abreviationCertificat = abreviationCertificat;
    	}
     
     
    	public  void modifier() throws Exception{
    		try{
     
    		}catch(Exception e){
    			e.printStackTrace();
    		}
     
    	}
    	public  void supprimer() throws Exception{
    		try{
     
    		}catch(Exception e){
    			e.printStackTrace();
    		}
     
    	}
    	public  void rechercher() throws Exception{
    		try{
     
    		}catch(Exception e){
    			e.printStackTrace();
    		}
     
    	}	
     
    	public void ajouterCertificat()
    	{
    		Session session = (Session) HibernateUtil.currentSession();
    		Transaction t = null;
     
    		session.beginTransaction();
    		CertificatVA c = new CertificatVA();
    		System.out.println(""+getLibelleCertificat());
    		c.setLibelleCertificat(libelleCertificat);
    		System.out.println(""+getAbreviationCertificat());
    		c.setAbreviationCertificat(abreviationCertificat);
    		session.save(c);
    		session.getTransaction().commit();
     
    	}
     
    	public  String nouveau() throws Exception{
    		try{
     
    		}catch(Exception e){
    			e.printStackTrace();
    		}
    		return "nouveau";
    	}
    	public  void effacer() throws Exception{
    		try{
     
    		}catch(Exception e){
    			e.printStackTrace();
    		}
    	}
    	public  String retour() throws Exception{
    		try{
     
    		}catch(Exception e){
    			e.printStackTrace();
    		}
    		return "retour";
    	}
     
     
    	public Set getRh() {
    		return rh;
    	}
    	public void setRh(Set rh) {
    		this.rh = rh;
    	}
    	public static long getSerialVersionUID() {
    		return serialVersionUID;
    	}
     
     
    }

    et dans mon faces-config j ai declarer ma classe bean comme suit :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
     
    <managed-bean>
    		<managed-bean-name>certificatVA</managed-bean-name>
    		<managed-bean-class>
    			sis.ma.gima.referentiel.pl.CertificatVA</managed-bean-class>
    		<managed-bean-scope>request</managed-bean-scope>
    	</managed-bean>
    si quelqu'un a une idée , merci de me répondre

  2. #2
    Rédacteur

    Profil pro
    Inscrit en
    Juin 2003
    Messages
    4 184
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2003
    Messages : 4 184
    Par défaut
    dans quelle partie tu as l'erreur? tu peux nous montrer l'exception?
    avec JSF l'erreur de conversion survient lorsque la valeur de l'objet n'est pas de type String ou de type primitif et aucun converter n'est utilisé.
    Si il s'agit d'une conversion coté base de donnée, ce n'est pas le forum adéquat.

  3. #3
    Membre averti
    Inscrit en
    Juillet 2010
    Messages
    11
    Détails du profil
    Informations forums :
    Inscription : Juillet 2010
    Messages : 11
    Par défaut
    le probleme c est que il n me genère aucune exception dans la console , mais la comme je met cette balise
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
     
    <div id="bottom_modules">
    							<div class="both">
    		 						<rich:messages showDetail="true" showSummary="true"></rich:messages>		
    							</div>
    il m affiche cette erreur
    pourtant quand j execute la fonction a l aide du main tt se déroule bien j crois k c est un probleme de la jsp nn ?

  4. #4
    Membre averti
    Inscrit en
    Juillet 2010
    Messages
    11
    Détails du profil
    Informations forums :
    Inscription : Juillet 2010
    Messages : 11
    Par défaut
    voila en ce qui concerne l erreur que j ai
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     
    sourceId=j_id_jsp_86029888_1:j_id_jsp_86029888_2[severity=(ERROR 2), summary=(Conversion error occurred.), detail=(Conversion error occurred.)]
    sourceId=j_id_jsp_86029888_1:j_id_jsp_86029888_3[severity=(ERROR 2), summary=(Conversion error occurred.), detail=(Conversion error occurred.)]

    merci de me répondre le plutot possible je suis desesperer .
    j ai vu dans d'autre forum que c est une erreur courrante pour jsf1.2 si quelqu'un a une idée merci de m répondre

Discussions similaires

  1. Réponses: 3
    Dernier message: 09/06/2011, 15h30
  2. Réponses: 6
    Dernier message: 07/12/2009, 13h56
  3. Réponses: 2
    Dernier message: 10/07/2009, 17h12
  4. Réponses: 3
    Dernier message: 30/10/2007, 13h38
  5. Sortie en erreur -> Truncation error occurred
    Par jfmerveille dans le forum Sybase
    Réponses: 2
    Dernier message: 10/04/2007, 08h32

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