struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marco Maier <>
Subject Re: [newbie] Prepopulating a form
Date Wed, 19 Mar 2003 12:42:52 GMT
Hi Johan,

try this...

DynaActionForm yourForm = (DynaActionForm) 	   	 
this.createDynaActionFormFromFormBeanConfig(yourFormName, mapping);

// prepopulate the form
httpSession.setAttribute(yourFormName, yourForm);

protected DynaActionForm 
createDynaActionFormFromFormBeanConfig(String 							name, ActionMapping 
   	throws InstantiationException, IllegalAccessException
   FormBeanConfig config = (FormBeanConfig) 			  					 

   DynaActionFormClass dynaClass = DynaActionFormClass.

   return ((DynaActionForm) dynaClass.newInstance());

hope this helps.


Johan Wasserman wrote:
> Hi,
> I need to populate a form from a StateBean (session) before displaying
> it.
> I cannot find anything to do it when using a FormBean (request) since
> the bean is initialised when loading the form and no methods are
> available to read the StateBean from the session (or so I think), any
> suggestions will be welcome.
> Thanks in advance.
> Johan Wasserman

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message