• 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

Newbie: How to get fields after Struts2 web form is submitted

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not very familiar with the struts2 framework yet, so I need your help on this scenario.
I have a form in a jsp with 15 fields. Once I submit the form, the request is passed on to the action and my question is "How do you get a hold of those fields (values).
I have read in many tutorials that you have to use getters and setters for each field and that works, but I think it's kind of cumbersome to do this for each form that I have because the same form fields will be used in multiple forms throughout the application and I don't want to have the same getters and setters declared in multiple places.

Is there a way to avoid this? Please please help!!!
Thanks,
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Then use a base class, or ModelDriven, or a property containing the common fields and additional properties on a per-action basis.
reply
    Bookmark Topic Watch Topic
  • New Topic