At 09:25 AM 5/2/02 +0200, you wrote:
Hi !
I'm a newbie with struts and I cannot find the right way to do a simple
thing like this :
I would like to create an HTML form to modify the user information I
recorded in my database.
I didn't find how to initialize my form on a user-basis (the userId is
stored in the session).
Thanks
Arnaud
---
Arnaud GADBY
EILEO
9ter rue Carnot
94270 Le Kremlin Bicetre
FRANCE
Hi Arnaud,
I guess that you're searching a way to initialise the form with the
informations
of the existing user. I've been faced with something similar. Here is what
I did :
The thing is that I haven't found a built-in way to pass the session
(containing the user id)
to the form implementation, and the ActionForm.reset() method that could
have been
used to populate the form with user data is not called (If somedy knows
why...).
So I created a specific Action in that goal. In the doPerfom method I
create a new instance of the form
bean and populate it with the user informations (that is in your session I
guess).
The key is that this new form instance should be set in your session with
the same attibute name
defined in struts-config form-bean
This Action is called by an 'edit user' link or button and forwards to the
user form page.
Hope this help.
Thierry Ruiz
SchlumbergerSema.
--
To unsubscribe, e-mail: mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]