struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Narayan, Anand" <ANara...@Juniper.com>
Subject RE: STRUTS and EJB
Date Thu, 23 Aug 2001 17:47:09 GMT
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
object
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 [mailto:dlongmuir@echoworx.com]
Sent: Thursday, August 23, 2001 1:46 PM
To: 'struts-user@jakarta.apache.org'
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? 

Derek. 

-----Original Message----- 
From: Juha Paananen [ mailto:juha.paananen@rtse.com
<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 <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/
<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 
> 



_______________________________________________________ 

Juniper Bank 
"Rated #1 in Customer Confidence" 
Gomez Inc., Summer 2001 Internet Credit Card Scorecard 
www.juniper.com 
_______________________________________________________ 

This e-mail and any files transmitted with it may contain confidential
and/or proprietary information. It is intended solely for the use of the
individual or entity who is the intended recipient. Unauthorized use of this
information is prohibited. If you have received this in error, please
contact the sender by replying to this message and delete this material from
any system it may be on.

Mime
View raw message