RECHERCHER :
COMMUNAUTE MP
Identifiez vous ...
Devenir Membre
J'ai oublié mon MDP
DOMAINE MP
Bavardages
Langages Généraux
Langages Web
Langages DotNet
Autres langages
Dev. Jeux Video
Sécurité
Sys. Exploitation
Graphismes
Logiciels
Réseaux
Bases de données
Méthodologies
Emplois High-tech
Aide juridique
Articles juridiques
FORUM
Index des forums
Ajouter un sujet
Rechercher sujet
Contact Responsable
Devenir modérateur
CHAT MP IRC
Votre pseudo ...
Srv: irc.moteurprog.com
Chan: #MoteurProg
PARTICIPER
Plus de 3500 emplois.
Rechercher un job
Déposez votre CV
Emplois High-tech

Visiteur MP

 remplire liste deroulante Struts

Forum : J2EE
Sous Catégorie : Aucune
Type du sujet : Sujet Normale
FAQ : FAQ J2EE

SUIVI DES SUJETS PAR MAIL

SUIVI PAR MAIL INACTIF

RESOLUTION DU SUJET SUJET NON RESOLU
BLOQUAGE DU SUJET SUJET ACTIF
APPARTENANCE A LA FAQ N'APPARTIENT PAS A LA FAQ


POSTER UN NOUVEAU SUJET REPONDRE A CE SUJET

FORUM J2EE

PREMIERE PAGE

PAGE PRECEDENTE

Page précedente

Page suivante

PAGE SUIVANTE

DERNIERE PAGE
totoprog
Nouveau membre
Avatar de totoprog
Inscrit : 03/03/2007
Messages : 25
Message
#141510
Posté le 23/08/07 à 07:12
slt ts le monde,
j'ai fait ces instructions pour recuperer les IdCour(cle etrangeres) dans une liste au chargement de ma page Jsp, mais ils ne sont pas charges dans ma liste deroulante et il m'affiche un message d'erreur.

Fonction execute de mon action:

////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public

ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {

AddpieceForm addpieceForm = (AddpieceForm) form;

// TODO Auto-generated method stub

PieceJoint pj=

new PieceJoint();
Courrier cour =

new Courrier();



Session session =

null;

SessionFactory sessionFactory =

new Configuration().configure().buildSessionFactory();
session = sessionFactory.openSession();

Transaction tx = session.beginTransaction();

Criteria crit = session.createCriteria(Courrier.

class);

Vector listeCour =

new Vector();

for (int i = 0; i < crit.list().size(); i++) {
listeCour.add(crit.list().get(i));

}


crit.list().size();


request.setAttribute(

"idCour", listeCour);



Long c = addpieceForm.getIdCour();


System.

out.println("\n c="+c);
cour = (Courrier) session.load(Courrier.

class,c);

pj.setCheminStock(addpieceForm.getChemin());

pj.setIdPiece(addpieceForm.getIdPiece());

pj.setCourrier(cour);


session.save(pj);


tx.commit();





return mapping.findForward("Success");
}

////////////////////////////////////////////////////////////////////////////////////////////

message d'erreur:

java.lang.IllegalArgumentException: id to load is required for loading

javax.servlet.jsp.JspException: No getter method available for property idcour for bean under name idcour.

//////////////////////////////////////////////////////////////////////////////////////////

Code ma page Jsp:

<%@ page language="java"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic"%>
<html>
<head>
<title>JSP for PieceForm form</title>
</head>
<body>
<html:form action="/piece">
chemin : <html:text property="chemin"/><html:errors property="chemin"/><br/>
idpiece : <html:text property="idpiece"/><html:errors property="idpiece"/><br/>
idcour : <html:select property="idcour">

<logic:present name="idcour">
<html:options collection="idcour" property="idcour"
labelProperty="idcour" />
</logic:present>

</html:select>
<html:submit/><html:cancel/>
</html:form>
</body>
</html>

//////////////////
merci d'avance.

HAUT DE PAGE

PROFIL MEMBRE LUI ECRIRE 


    PAGE : [1]



.: Site Web développé par Julien Pichot et l'équipe MPWG avec www.evolvia-web.com :.