RE: Creating ActionForm in ActionClass

2002-11-06 Thread Taariq Levack
If am creating an instance of my ActionForm in my ActionClass,
what happens if there already exists an instance of the ActionForm I am
creating ?
marcus


isn't your ActionClass passed an instance of the ActionForm in the
execute method?

--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




RE: Creating ActionForm in ActionClass

2002-11-06 Thread Andrew Hill
Rather up to you. You could ditch it, by setting the one you created in its
place in the request or session if you want.

I reckon you would be better off leaving the instantiating of the ActionForm
to struts though and using the one it supplies to you as a parameter.

-Original Message-
From: Taariq Levack [mailto:taariq.levack;tasima.co.za]
Sent: Wednesday, November 06, 2002 17:59
To: Struts Users Mailing List
Subject: RE: Creating ActionForm in ActionClass


If am creating an instance of my ActionForm in my ActionClass,
what happens if there already exists an instance of the ActionForm I am
creating ?
marcus


isn't your ActionClass passed an instance of the ActionForm in the
execute method?

--
To unsubscribe, e-mail:
mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail:
mailto:struts-user-help;jakarta.apache.org


--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




Re: Creating ActionForm in ActionClass

2002-11-06 Thread Marcus Biel
Well,
I have to admit, the more I learn about Struts,
I realize the more things I don't know exactly.


isn't your ActionClass passed an instance of the ActionForm in the
execute method?

Of course I pass an instance of the ActionForm into my execute method,
but I am simple using ActionForm form and not my myActionForm myForm
Ok, my myActionForm extends the ActionForm, but imho when using
ActionForm form
it's not mine, but the Struts standard form, right ?


AH! I guess I just understood:
MyForm myForm = (MyForm)form;

As I am doing an explicit type conversion from form to MyForm myForm,
I bet that I've not passed the ActionForm but my myActionForm,
and so I am just using the right one.
right ???

But when I used myForm /created a new form in my Action(depending on
what's right),
at the end I put myForm into session scope, just like I have configured
myForm in struts-config.
But then another, empty form was accessed from my view.
When I put the form I used /created in my Action(depending on what's
right) into request scope,
instead of session scope like myForm is set in struts-config,
the right form was accessed from my view.

This would mean that the form I am using / creating in my Action is
another form then the one Struts creates for me automatically.
The only reason that myForm is accessed, is that Struts searches at
first in request scope and only if no form has been found,
it will also search in session scope.

Can anybody follow what I am trying to say / trying to know ?


marcus




[EMAIL PROTECTED] schrieb:
 
 Rather up to you. You could ditch it, by setting the one you created in its
 place in the request or session if you want.
 
 I reckon you would be better off leaving the instantiating of the ActionForm
 to struts though and using the one it supplies to you as a parameter.
 
 -Original Message-
 From: Taariq Levack [mailto:taariq.levack;tasima.co.za]
 Sent: Wednesday, November 06, 2002 17:59
 To: Struts Users Mailing List
 Subject: RE: Creating ActionForm in ActionClass
 
 If am creating an instance of my ActionForm in my ActionClass,
 what happens if there already exists an instance of the ActionForm I am
 creating ?
 marcus
 
 isn't your ActionClass passed an instance of the ActionForm in the
 execute method?
 
 --
 To unsubscribe, e-mail:
 mailto:struts-user-unsubscribe;jakarta.apache.org
 For additional commands, e-mail:
 mailto:struts-user-help;jakarta.apache.org
 
 --
 To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
 For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org

--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org