ActionForm method(ActionForm actionForm) { // set the same reference. ActionForm af = actionForm; // now reset the form with that reference af = DynamicActionFormFactory.getBlankForm(name,type,fields); return af; }
This make sense to you?
Michael McGrady
At 02:15 PM 8/6/2004, you wrote:
Java passes a *copy* of the reference (thus, Java always passes parameters using call-by-value), not the actual reference. So, changing the passed-in reference from within the method to refer to a different object will not cause a change in the reference of the guy who called the method -- his reference will still refer to the old (unchanged) object. However, since the passed-in reference refers to the same object as the caller's reference, you can modify the object itself via your reference and the caller will see the changes. So you could invoke setParameter, etc., on the ActionMapping provided . . .
It's a matter of syntax really, you can still accomplish what you are talking about.
Erik
Michael McGrady wrote:
At 01:44 PM 8/6/2004, you wrote:
If I understand you correctly...
Same issue.... it's passed into the execute method, and therefore you can't change it, only it's internals, so you would have to do the same thing there.
I'm talking specifically in the execute method, which is where I think you're trying to create the form.
I'm perhaps confused, then, Jim. My understanding is that Java never passes more than the reference, so why could we not change the mapping and the form in execute? Why cannot we, in other words, take the reference and reinitialize it to a different ActionForm, ActionMapping, or whatever?
Michael McGrady
--------------------------------------------------------------------- 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]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]