Emmanuel.Leguy a écrit :


Yes name is specified. I think it needs more explanations. My action sequence is:

jsp0 -------> Action1--------> jsp1 ---------> Action2 --------> jsp2
                        |                                               |
                  Formbean1                             Formbean2

I would like to pre-populate Formbean2 in Action1 to put default values in jsp1. Formbean2 specifies a name property. Unfortunately, when i code this

DynaActionForm dForm = (DynaActionForm) form;
dForm.set( "name", person.getName() );

in Action1 dForm refers to Formbean1 (not Formbean2). Formbean1 is used to get informations entered in jsp0. Since Formbean1 does not specify a name property (it does not need any), i get an error.

My question is then:

How to populate Formbean2 in Action1?

Fixed!

I red the struts doc again and i solved my problem. I did not understand that i need 2 actions: an action to populate the form (before the jsp is displayed) and one to process the user infos. So my flow is now:


jsp0 -------> Action1-------->prepareAction ---------> jsp1 ---------> Action2 --------> jsp2 | | | Formbean1 Formbean2(pre-populated) Formbean2

and it works!!!

Thanx for all,

Manu.

--
Emmanuel Leguy                  LIFL - UMR8022 CNRS - Bat M3
Tel: +33 3 28 77 85 32          USTL - Universite de Lille 1
Fax: +33 3 28 77 85 37          59655 VILLENEUVE D'ASCQ CEDEX - FRANCE

mailto:[EMAIL PROTECTED]        
http://www.lifl.fr/ANNUAIRE/employee.php?login=leguye

Ce mail est signe par un certificat X509 fourni par le CNRS
La verification de ce certificat peut etre faite a l'adresse suivante: http://igc.services.cnrs.fr/CNRS-Standard/recherche.html

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to