You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Kishore Venkatesh <ki...@gmail.com> on 2020/04/14 09:38:30 UTC

struts 1 to struts 2 migration , virtual form replacement query

Hi 

I'm migrating an application from struts 1 to struts 2, I have some forms and form beans defined  in struts-config.xml . How do I map these into struts 2. I know about struts 2 forms , and mapping form to user bean . My question how do I map virtual forms in struts 2.

Thanks

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


Re: struts 1 to struts 2 migration , virtual form replacement query

Posted by Lukasz Lenart <lu...@apache.org>.
pt., 17 kwi 2020 o 13:42 Kishore Venkatesh <ki...@gmail.com> napisał(a):
>
> Thanks for the response. After I create an action with setters and getters , how can I use this action in javascript functions.

Not sure if I understand, what do you want to achieve? Maybe some example?


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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


Re: struts 1 to struts 2 migration , virtual form replacement query

Posted by Kishore Venkatesh <ki...@gmail.com>.
Thanks for the response. After I create an action with setters and getters , how can I use this action in javascript functions. 

On 2020/04/15 05:26:03, Lukasz Lenart <lu...@apache.org> wrote: 
> wt., 14 kwi 2020 o 12:36 Kishore Venkatesh <ki...@gmail.com> napisał(a):
> > I'm migrating an application from struts 1 to struts 2, I have some forms and form beans defined  in struts-config.xml . How do I map these into struts 2. I know about struts 2 forms , and mapping form to user bean . My question how do I map virtual forms in struts 2.
> 
> You meant DynaActionForm? In such case you must create an action with
> all the fields and setters you need. You can always access passed
> values via Named Objects, but this rather a weak solution as you loose
> framework's conversion and validation abilities.
> 
> https://struts.apache.org/tag-developers/ognl-basics#struts-2-named-objects
> 
> 
> Regards
> -- 
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 

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


Re: struts 1 to struts 2 migration , virtual form replacement query

Posted by Lukasz Lenart <lu...@apache.org>.
wt., 14 kwi 2020 o 12:36 Kishore Venkatesh <ki...@gmail.com> napisał(a):
> I'm migrating an application from struts 1 to struts 2, I have some forms and form beans defined  in struts-config.xml . How do I map these into struts 2. I know about struts 2 forms , and mapping form to user bean . My question how do I map virtual forms in struts 2.

You meant DynaActionForm? In such case you must create an action with
all the fields and setters you need. You can always access passed
values via Named Objects, but this rather a weak solution as you loose
framework's conversion and validation abilities.

https://struts.apache.org/tag-developers/ognl-basics#struts-2-named-objects


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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