Also check description and known subclasses http://jakarta.apache.org/struts/api/org/apache/struts/action/DynaActionForm .html
--Alen ----- Original Message ----- From: "Alen Ribic" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Wednesday, June 18, 2003 5:15 PM Subject: Re: Making Value Objects Into Form Objects > > ----- Original Message ----- > From: "Weissman, Alan" <[EMAIL PROTECTED]> > To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]> > Sent: Wednesday, June 18, 2003 5:07 PM > Subject: Making Value Objects Into Form Objects > > > > > > Ok so I'm a little new to Struts but not J2EE and I've been noticing that > my > > Value Objects that come out of EJB's in my data layer are the exact same > > objects as the ActionForms that are used by Struts....and I'm sure I'm not > > the first to notice this. > > > > So here's my question: How can I make one class that can serve as both an > > ActionForm and a ValueObject? > > use org.apache.struts.action.DynaActionForm (Or one of the Dyna validator > form classes) > and define form-bean in struts config file. > > This way you will not need to define a ActionFrom for every form you work > with. > > Then you use BeanUtils.copyProperties(...); method to copy bean properties > from one to you value object. > > --Alen > > > > > The problems with solutions that I've brainstormed are this: > > > > 1) I can't make my Value Objects extend ActionForm for obvious reasons. > > 2) I would rather not use an interface to get around this issue because > then > > I have two classes to maintain again. > > > > Thanks for any advice! > > > > Alan > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]