You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Matt Raible <ma...@raibledesigns.com> on 2003/01/07 05:10:16 UTC

RE: DynaActionFormClass.getDynaActionFormClass [nevermind]

Nevermind, this seems to work:

FormBeanConfig cfg = 
	
mapping.getModuleConfig().findFormBeanConfig(Constants.REQUEST_KEY);

DynaActionForm requestForm = 
	(DynaActionForm)
DynaActionFormClass.createDynaActionFormClass(cfg).newInstance(); 

Matt


> -----Original Message-----
> From: Matt Raible [mailto:matt@raibledesigns.com] 
> Sent: Monday, January 06, 2003 8:52 PM
> To: 'Struts Developers List'
> Subject: RE: DynaActionFormClass.getDynaActionFormClass
> 
> 
> After looking at this method, I don't know that it will work for me:
> 
> createActionForm(javax.servlet.http.HttpServletRequest request,
> 	ActionMapping mapping, ModuleConfig moduleConfig, 
> ActionServlet servlet) 
> 
> My form is not associated with a particular mapping, as I'm 
> creating it on the fly and using it to send an e-mail 
> message.  There's got to be an easy way to do this - any examples?
> 
> How do I get the mapping if the form is not associated with 
> any actions - or even if it is?
> 
> This was working great for me in 1.1b2:
> 
> DynaActionForm requestForm = (DynaActionForm) DynaActionFormClass
> 	.getDynaActionFormClass(Constants.REQUEST_KEY).newInstance();
> 
> But now it's gone :(  I'd love a quick HowTo for writing this 
> same logic with Struts 1.1 b3.  
> 
> Thanks,
> 
> Matt
> 
> > -----Original Message-----
> > From: Craig R. McClanahan [mailto:craigmcc@apache.org]
> > Sent: Sunday, January 05, 2003 6:26 PM
> > To: Struts Developers List
> > Subject: RE: DynaActionFormClass.getDynaActionFormClass
> > 
> > 
> > 
> > 
> > On Sun, 5 Jan 2003, Matt Raible wrote:
> > 
> > > Date: Sun, 5 Jan 2003 17:12:51 -0700
> > > From: Matt Raible <ma...@raibledesigns.com>
> > > Reply-To: Struts Developers List <st...@jakarta.apache.org>
> > > To: 'Struts Developers List' <st...@jakarta.apache.org>
> > > Subject: RE: DynaActionFormClass.getDynaActionFormClass
> > >
> > > Has it become as easy as:
> > >
> > > DynaActionForm myForm = new DynaActionForm();
> > >
> > > ?? Man - that would be slick if (true)!
> > >
> > 
> > Unfortunately, that is not technically feasible :-).
> > 
> > Your best bet is the utility method
> > RequestUtils.createActionForm().  As an extra added 
> > advantage, this works for either standard ActionForm beans or 
> > DynaActionForm beans.
> > 
> > > Thanks,
> > >
> > > Matt
> > 
> > Craig
> > 
> > 
> > --
> > To unsubscribe, e-mail:   
> > <mailto:struts-dev-> unsubscribe@jakarta.apache.org>
> > For
> > additional commands, 
> > e-mail: <ma...@jakarta.apache.org>
> > 
> 



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>