It's really simple using your way. Thank you :)

I can do that with Struts 1.2 (eclipse 3.0, exadel 2.5), but it seems to me 
that it doesn't work in JDeveloper 10.1.2.0.0 build 1811) which uses Struts 
1.1. Does anybody know that it is because of Struts 1.1 or because of my 
program?

>>> [EMAIL PROTECTED] 6/29/2005 10:55:01 AM >>>
It's pretty simple; you just need to populate the form bean and put it
into request/session scope prior to forwarding to your jsp when in edit
mode.  You'll also need a hidden variable in your form to flag whether
you're in edit or add mode, so your backend does the appropriate DB
action.

The mailreader example app that ships with struts shows the basic
approach to doing this.  I suggest that you look at that code and see
how they do it there.

- Scott

> -----Original Message-----
> From: Thai Dang Vu [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, June 29, 2005 10:27 AM
> To: user@struts.apache.org 
> Subject: Populating the ActionForm without using the reset method?
> 
> Hi all,
> 
> Maybe I ask too much but I'm just a newbie in Struts and 
> nobody in my department can help me :(
> 
> This is my situation: I have an input.jsp page to let users 
> enter data and click 'Save'. There's another function that 
> the data is fetched from the database and users can modify 
> them and then save them. I want to make only 1 jsp page to 
> enter new data as well as edit the existing data (that is the 
> input.jsp page). So what is the best way to write the 
> input.jsp file so that sometimes its fields are blank (for 
> inputing purpose) and sometimes its fields are populated with 
> some values (for editing purpose)? For editing purpose, the 
> values are undetermined beforehand so I couln't put them in 
> the reset method.
> 
> Sincerely.
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED] 
> For additional commands, e-mail: [EMAIL PROTECTED] 
> 
> 

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




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

Reply via email to