• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts2 - Difficulties in handling form data

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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 ]
 
Those who dance are thought mad by those who hear not the music. This tiny ad plays the bagpipes:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic