struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dun...@sapio.co.uk (Duncan Harris)
Subject Form Beans not derived from ActionForm
Date Thu, 01 Jan 1970 00:00:00 GMT

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:struts-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-dev-help@jakarta.apache.org>


Mime
View raw message