Re: how do struts resolve the variable?

2006-08-15 Thread Li

for your *1 (step 1?)

You can get ActionForm object from a set of parameters that passed to
your Action class
You can cast according to your form type (e.g. MyActionForm) accordingly.

for your *2 (step 2?)
You save the form to your session with a key called myForm, after
that, you are using your myForm as bean not a ActionForm any more.
Which means, the ActionForm object that passed to your current action
class is totally different from the one you saved in the session ...


On 8/15/06, Michael Cheung [EMAIL PROTECTED] wrote:

Hi, all;

I create some action which have form on it.
Sometime I can access the ActionForm bean via classname,
sometime I can access it via variablename(*1), and sometime
I have to set it into request object (*2) to access it.

*1:
in Action, write this code, and access ActionForm via myForm.
MyActionForm myForm = (MyActionForm) form;

*2:
request.setAttribute(myForm,myForm);

Anyone can tell me the reason?

Regards;
Michael


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
When we invent time, we invent death.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



how do struts resolve the variable?

2006-08-14 Thread Michael Cheung
Hi, all;

I create some action which have form on it.
Sometime I can access the ActionForm bean via classname,
sometime I can access it via variablename(*1), and sometime
I have to set it into request object (*2) to access it.

*1:
in Action, write this code, and access ActionForm via myForm.
MyActionForm myForm = (MyActionForm) form;

*2:
request.setAttribute(myForm,myForm);

Anyone can tell me the reason?

Regards;
Michael


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]