Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

When is form Bean created ?

 
Shaan patil
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • 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
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic