aspose file tools*
The moose likes Struts and the fly likes Struts2 - Difficulties in handling form data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2 - Difficulties in handling form data" Watch "Struts2 - Difficulties in handling form data" New topic
Author

Struts2 - Difficulties in handling form data

Senthilkumar Adaickalam
Greenhorn

Joined: Nov 08, 2004
Posts: 14
Hi,

we have developed a web application using struts 1.38 + spring + hibernate and we now want to migrate it into Struts 2. I went thro the struts 2 documentation and understand that formbeans have been removed completely from the framework. Without formbean, its fine for the forms having few fields but what will happen if the form has more number of data. Do we need to add setters and getters in action class for each field? If yes, i feel it decreases the productivity compare to the struts 1's dyna action forms where we just define the form in struts-config.xml.

Please clarify.


Thanks and Regards,<br />Senthil
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8997
    
    9

Originally posted by Senthilkumar Adaickalam:
Do we need to add setters and getters in action class for each field?


No. My approach is to use the same POJO I use with Hibernate and make a get/set POJO method on the Action (see the CRUD Demo for an example).
I'm sure there's other ways to do it. ModelDrivenInterceptor for one.
[ April 23, 2008: Message edited by: Joe Ess ]

[How To Ask Questions On JavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts2 - Difficulties in handling form data