Yes thanks, you get the result I wanted by overwriting the bean in request/session scope with the name used in struts config. (name attrib in action mapping struts-config.xml)
-----Original Message----- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Friday, August 20, 2004 7:31 PM To: Struts Users Mailing List Subject: Re: form problem Struts creates and stores the ActionForm in request or session scope. If you create a new form to replace the one automatically created by Struts, you also need to store it under the appropriate key in either the session or request. Look at the the processActionForm() method in RequestProcessor - you need to store it the same way. http://cvs.apache.org/viewcvs.cgi/jakarta-struts/src/share/org/apache/st ruts/action/ Niall ----- Original Message ----- From: "Lucero, Dennis M" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, August 21, 2004 1:52 AM Subject: form problem Does anyone know how to do this or why it does not work? Both these methods would be called from an action class. Function void useMyForm(ActionForm form){ SomeFormClass myForm = new SomeFormClass(); myForm.setName("Blah"); myForm.setAge("289"); etc... form = myForm; } When I get to the jsp the fields are not populated with the form variables . why does this not work but the following way does. Function void fillInForm(ActionForm form){ SomeFormClass myForm = (SomeFormClass)form; myForm.setName("Blah"); myForm.setAge("289"); etc... } Using this "normal" way when I get to the jsp the fields are populated with the form variables. How can a use something similar to the first method? I am he, as you are he, as you are me, and we are all together. --------------------------------------------------------------------- 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]