struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Moore" <tmo...@blackboard.com>
Subject RE: Form Beans not derived from ActionForm
Date Fri, 18 Jan 2002 19:41:18 GMT
It would be pretty easy to make an ActionForm subclass that does just
this by wrapping some arbitrary bean.  No modification to Struts
framework code would be necessary.  You can use nested property syntax
to access properties of the contained bean(s) from JSPs.

-- 
Tim Moore / Blackboard Inc. / Software Engineer
1899 L Street, NW / 5th Floor / Washington, DC 20036
Phone 202-463-4860 ext. 258 / Fax 202-463-4863


> -----Original Message-----
> From: Duncan Harris [mailto:duncan@sapio.co.uk] 
> Sent: Friday, January 18, 2002 10:37 AM
> To: struts-dev@jakarta.apache.org
> Cc: duncan@sapio.co.uk
> Subject: Form Beans not derived from ActionForm
> 
> 
> 
> 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>
> 
> 

--
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