struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Derek Longmuir <dlongm...@echoworx.com>
Subject RE: STRUTS and EJB
Date Thu, 23 Aug 2001 17:46:25 GMT
Why not make a Value object for passing the information around, and have the
form hold an instance of the value object?

Derek.

-----Original Message-----
From: Juha Paananen [mailto:juha.paananen@rtse.com]
Sent: Thursday, August 23, 2001 1:47 PM
To: struts-user@jakarta.apache.org
Subject: RE: STRUTS and EJB


I also agree on that stuff that has references to STRUTS should not be
transmitted to the EJB level. The problem here is simply that I would
not want to make another, exactly similar (except "extends ActionForm"),
class for transporting the information to the EJB. Of course, I can do
that, but I don't like the idea. My question is, is this inheritance of
ActionForm really necessary in Struts design?

> -----Original Message-----
> From: Ted Husted [mailto:husted@apache.org]
> Sent: 23. elokuuta 2001 20:29
> To: struts-user@jakarta.apache.org
> Subject: Re: STRUTS and EJB
> 
> 
> I agree with Gregor. The ActionForm beans are best left as ActionForm
> beans, and used only as an extension of the html:form tags. Once the
> data is validated, it should be transferred to persistent 
> stoarge, or to
> another bean that is not bound to the HTTP layer (and could be re-used
> in other environments). This bean can then use the right data-type for
> the job, and perform other business tasks that have nothing to do with
> gathering input from HTTP. 
> 
> On the way back, a good way to repopulate an ActionForm bean, or other
> string-based helper, is to have your data access objects return a Map,
> and then use it with the standard BeanUtils.populate() method. Struts
> does the same thing with the HTTP request, which is basically a Map.
> 
> -- Ted Husted, Husted dot Com, Fairport NY USA.
> -- Custom Software ~ Technical Services.
> -- Tel +1 716 737-3463
> -- http://www.husted.com/about/struts/
> 
> Gregor Rayman wrote:
> > 
> > "Juha Paananen" <juha.paananen@rtse.com> wrote:
> > 
> > > I want to fill in a form JavaBean using a struts form, and after
> > > validating it in my Action class, store it into the db 
> using a session
> > > EJB component. The proble here is that I have to extend 
> ActionForm class
> > > to make the bean work with Struts.
> > 
> > You can use containment instead of inheritance. You should 
> avoid using
> > Struts ActionForm on the business logic level.
> > 
> > --
> > gR
> 

Mime
View raw message