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/struts/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]

Reply via email to