Pass Alot of Parameters on a Form to Action Struts2
Posted
by
Neeraj
on Stack Overflow
See other posts from Stack Overflow
or by Neeraj
Published on 2012-04-10T23:08:34Z
Indexed on
2012/04/10
23:29 UTC
Read the original article
Hit count: 242
I have been working on migrating a web application from Struts1 to Struts2.
I have a simple Form with around 45 Fields (basically a grid with data). I have to capture all those in Struts2 Action.I noticed that in struts2 we have OGNL through which we just write getters setters in action itself by declaring fields locally to get those variables flowing in the request. I cannot write 45 getters/setters in my action, there must be a way to pass whole object(a POJO) from jsp to Action layer.
In Struts 1, we normally get a ActionForm Object and/or get request parameters in a map and then populate.
Any help or suggestions will be appreciated.
© Stack Overflow or respective owner