struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jim Barrows" <jbarr...@sssc.com>
Subject RE: Pre-populating a form from a database
Date Thu, 02 Dec 2004 17:11:39 GMT
> -----Original Message-----
> From: Donie Kelly [mailto:donie.kelly@tecnomen.ie]
> Sent: Thursday, December 02, 2004 9:57 AM
> To: Struts Users Mailing List
> Subject: RE: Pre-populating a form from a database
> 
> 
> Hi (and sorry for the noob question)

It's what we're here for :)

> 
> I am using a DTO object to transfer the data from the data 
> access object. I
> copy that data from the Dto to the form in the action class 
> and it works
> when I resubmit the page (refresh) becuase the action is triggered.
> 
> However, I can't get the action to trigger when I go to the 
> form initially.
> I am a bit lost on this one even though I'm trying to understand these
> tutorials.

If you're going to the form from /context/path/page.jsp, then it's because the action is only
triggered when you go to /context/path/action.do.
If you're saying that you are going to /context/path/action.do and the data is only showing
up when you refresh.. thats a different problem, probably related to your action class, which
I would need to see.


> 
> Thanks
> Donie
> 
> 
> -----Original Message-----
> From: Jim Barrows [mailto:jbarrows@sssc.com] 
> Sent: 02 December 2004 16:59
> To: Struts Users Mailing List
> Subject: RE: Pre-populating a form from a database
> 
> The form bean is a not a data access object!!!!!!!
> Get the data in the action class, populate the form bean from that.
> FormBeans are for display only.
> 
> > -----Original Message-----
> > From: Donie Kelly [mailto:donie.kelly@tecnomen.ie]
> > Sent: Thursday, December 02, 2004 9:43 AM
> > To: Struts Users Mailing List
> > Subject: Pre-populating a form from a database
> > 
> > 
> > Hi all
> > 
> >  
> > 
> > I've been going through the tutorials at
> > http://www.coreservlets.com/Apache-Struts-Tutorial/index.html
> > <http://www.coreservlets.com/Apache-Struts-Tutorial/index.html
> > >  which shows
> > how to pre-populate forms.
> > 
> >  
> > 
> > However, as I'm new to this, is there a "proper" way to 
> > access the database
> > through the form bean? Sould I put code in the form 
> > constructor class to
> > initialise the data? Or does struts have a better way?
> > 
> >  
> > 
> > Thanks
> > 
> > donie
> > 
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message