On Mon, 29 Jul 2002, David Graham wrote:
> I'm pretty new to struts and have figured out how to do an "add" form  where 
> you start with an empty set of text boxes, fill them in, and when you submit 
> it puts the data into a database.
> How do I setup an "edit" form where you get a url like
> /updatePerson.jsp?id=61 where id is the person id from the database?
> I need to query the database based on the id and prefill the text boxes.

What I usually do is have an edit action and a save action. They both have
the same form bean associated with them. In the edit action, you will have
access to the form bean, so you can grab your data from the database and
do something like:

MyFormBean fb = (MyFormBean) form;

fb.setName("dave");

and forward to your form.

dave

-- 
Dave Weis             "I believe there are more instances of the abridgment
[EMAIL PROTECTED]   of the freedom of the people by gradual and silent
                      encroachments of those in power than by violent 
                      and sudden usurpations."- James Madison


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to