struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Li <ampyx...@gmail.com>
Subject Re: how do struts resolve the variable?
Date Tue, 15 Aug 2006 07:21:14 GMT
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 <vividy@justware.co.jp> 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: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
When we invent time, we invent death.

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


Mime
View raw message