Hi All, Just tried it out as defined in the struts link below and it works a treat...
You don't need to instantiate an instance of the form, as this has already been done for you by the Struts framework before the Action is reached, and you don't need to set the form as a request attribute. My edit action method (the pre-populating action) is as follows: public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response ) throws Exception { UserRegForm userRegForm = (UserRegForm)form; userRegForm.setEmailAddressDisplay("defaultValue"); // return the ActionForward you use for success return mapping.findForward("success"); } -----Original Message----- From: Robin Mannering [mailto:[EMAIL PROTECTED] Sent: 05 October 2004 17:55 To: Struts Users Mailing List Subject: RE: input form Hi All, Just chewing over this problem myself since it was brought up. The solution is here I believe, yet to implement it but I'm sure it'll work. http://struts.apache.org/faqs/newbie.html#prepopulate Hope this helps, not sure if it repeats what has been said already. Robin -----Original Message----- From: Fogleson, Allen [mailto:[EMAIL PROTECTED] Sent: 05 October 2004 17:32 To: 'Struts Users Mailing List' Subject: RE: input form Wendy, True enough, the original question though revolved around prepopulating the form from the DB before getting to the view of the submitting page so that initial page would have data pre-populated. :) Al -----Original Message----- From: Wendy Smoak [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 05, 2004 12:05 PM To: Struts Users Mailing List Subject: Re: input form From: "Freddy Villalba A." <[EMAIL PROTECTED]> > I have a similar question: when you say create the action form and put it > into request scope... I suppose you refer to the same ActionForm that will > be used when, say, saving that prepopulated form again (the changes you've > made). Struts will instantiate the ActionForm and place it in the correct scope according to your struts-config.xml setup. All you have to do is use the 'form' object that's passed into your 'execute' (or similar) method, setting values as necessary. You have a reference to the form, you don't have to worry about where it lives, or put it anywhere. -- Wendy Smoak --------------------------------------------------------------------- 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] ==================================================================== This e-mail and any attachments may be confidential and/or legally privileged. If you have received this e-mail and you are not a named addressee, please inform Landmark Information Group on 01491 413030 and then delete the e-mail from your system. If you are not a named addressee you must not use, disclose, distribute, copy, print or rely on this e-mail. This email and any attachments have been scanned for viruses and to the best of our knowledge are clean. To ensure regulatory compliance and for the protection of our clients and business, we may monitor and read e-mails sent to and from our servers. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ==================================================================== This e-mail and any attachments may be confidential and/or legally privileged. If you have received this e-mail and you are not a named addressee, please inform Landmark Information Group on 01491 413030 and then delete the e-mail from your system. If you are not a named addressee you must not use, disclose, distribute, copy, print or rely on this e-mail. This email and any attachments have been scanned for viruses and to the best of our knowledge are clean. To ensure regulatory compliance and for the protection of our clients and business, we may monitor and read e-mails sent to and from our servers. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]