• 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

When form beans are populated and can we merge form beans with action class?

 
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I am new to struts.
I want to know the followings:-

1. When in struts flow form beans are populated and who does it?
2. As because form beans sole responsibility is to get and set data can we merge it with Action class ?

 
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

1. When in struts flow form beans are populated and who does it?


They are populated before your action is called (not sure exactly when). Its the responsibility of struts to set its values (not sure exactly how, its done using interceptors in struts 2, must be a similar approach in struts 1 too)

2. As because form beans sole responsibility is to get and set data can we merge it with Action class ?


I'm not sure if this can be done in struts 1 (easy to do in struts 2). Try to make the action as a form bean declaration in your struts-config file. Still you'll have to use the FormBean object passed as parameter to the action. You can't use properties of your action in JSPs directly...
reply
    Bookmark Topic Watch Topic
  • New Topic