Very few pre-existing beans would meet the design requirements of
ActionForm beans. 

http://jguru.com/faq/view.jsp?EID=471954

As mentioned, you can use the dotted syntax to nest other beans, but its
usually easier to transfer the data in the Action after the validation
is said and done.

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Java Web Development with Struts.
-- Tel +1 585 737-3463.
-- Web http://www.husted.com/struts/


Duncan Harris wrote:
> 
> I am using struts 1.01 and haven't looked at 1.1 code yet, so please
> excuse if this has been addressed.
> 
> I would like some of my form beans to not have a dependency on struts
> so I can use them in other apps that operate on the same back end, but
> are not web apps.
> 
> I can't see struts couldn't be modified so that this was optionally the case.
> Struts could still pass the ActionForm into the perform(), but there might
> be a getBean() method on it to handle this case (obviously your perform code
> would know which type of bean it was expecting). Also getBean() could
> return 'this' if the bean was derived from ActionForm.
> 
> The struts code could detect whether the bean class was derived from
> ActionForm and do slightly different things in each case. For example
> it could call reset() via reflection on the bean when the bean class was
> not derived rom ActionForm.
> 
> Has anyone else considered this requirement for a bean which is not
> dependent on struts to be used as a form bean?
> 
> Duncan Harris
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Hartford, Cheshire, U.K., Tel: 07968 060418
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

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

Reply via email to