• 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 is form Bean created ?

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

I need to know when exactly a form bean is created ?

Is it created after we submitt or before we submitt a form ?

If it is reated after we submitt a form, then How is prepopulation of fields in the form takes place ?


Regards
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Shaan,
I searched for "action form life cycle". The first hit was a clear ordered listing of the steps.
 
Shaan patil
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI,

Thanks for the link. I went throught it.

If we follow the steps listed there,then How do you explain pre-populating of form fields(Default values in text fields of a form from default bean values ) when a jsp is requested ?


Regards
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This same life cycle occurs even if you just request a JSP that uses Struts tags. The first time the JSP engine encounters a Struts tag, it will initiate the ActionForm lifecycle.

Step 2 (Create or recycle ActionForm) and step 3 (call reset) is where any default values are placed into an ActionForm. If the form is in session scope and existed before this request, any values placed in the ActionForm properties by previous requests will still be there.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic