struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Derek Longmuir <>
Subject RE: STRUTS and EJB
Date Thu, 23 Aug 2001 18:08:07 GMT
<html:text property="valueObjectA.someNumber" size="5" maxlength="5" />

Where the form has a Value object ValueObjectA, along with a "public
ValueObjectA getValueObjectA()" method. The value object has a String
someNumber in it, with a "public String getSomeNumber()" method.

Doesn't one of the sample applications or Ted's examples show this a lot


-----Original Message-----
From: Narayan, Anand []
Sent: Thursday, August 23, 2001 1:47 PM
To: ''
Subject: RE: STRUTS and EJB

If a value object is used within the ActionForm for holding the form data,
how should the html elements be named so that the data elements in the value
is automatically populated.  Or should the data elements also reside in the
ActionForm as
separate fields, for which the setters and getters would go and get the
information from the value object ?
Anand Narayan 

-----Original Message-----
From: Derek Longmuir []
Sent: Thursday, August 23, 2001 1:46 PM
To: ''
Subject: RE: STRUTS and EJB

Why not make a Value object for passing the information around, and have the
form hold an instance of the value object? 
-----Original Message----- 
From: Juha Paananen [] 
Sent: Thursday, August 23, 2001 1:47 PM 
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 [] 
> Sent: 23. elokuuta 2001 20:29 
> To: 
> 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 
> -- 
> Gregor Rayman wrote: 
> > 
> > "Juha Paananen" <> 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 

View raw message