--- Wendy Smoak <[EMAIL PROTECTED]> wrote:
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> > because of the fact, that i´ve got no access to this bean in my 
> > preprocessing action. testSelect is a member of the upcoming 
> > DynaActionValidatorForm with is initiatet during the 
> > <html:form/> tag of my JSP.
> 
> Nope.  It goes request->form creation->action.  You are being passed the
> form in the signature of ActionForm.execute(), all you have to do is cast
> it to the right type:
> 
>       DynaActionForm dForm = (DynaActionForm) form;

This would only be true if the action that was called specified that form in
its mapping.  If this is a preprocessing action (that's being called to
provide an HTML form with data to show), and there's no "name" attribute to
tie a form to it, Struts will not create/populate a form (because it wouldn't
know what form to create).  

You can make the form available to this action if you specify the form you
want in the "name" attribute in this action's mapping.  However, this would
not be good practice since the preprocessing action could itself require a
form of a different type. 

> 
> Now set whatever properties of dForm you need to, then forward to the JSP.
> 
> > You are right the sbBean and the DynaActionValidatorForm have exactly 
> > the same members which seems to be a big design failure in my 
> > application. I should get rid of the sbBean and initiate the 
> > DynaActionValidatorForm earlier in my preprocessing action.
> 
> Not recommended.  They might be the same *now* but if your business object
> changes in the future, you don't want that to be tied so closely to your
> webapp.  Since you're using dyanamic forms, it's not THAT much trouble to
> maintain a business object plus some lines of XML.  Or you can use a tool
> to generate all the get/set methods for a regular ActionForm.
> 
> -- 
> Wendy Smoak
> Application Systems Analyst, Sr.
> ASU IA Information Resources Management 


__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to