• 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

confused about the reset () method

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The book 'Professional Struts Applications - Building Websites ...' says following about reset() method:

"<b>If the developer declares that the ActionForm is to be placed in the session, the reset() method will not be invoked</b>. The ActionServlet will bypass the reset() method, populate the properties in the ActionForm with the data from the user's request, and then call the validate() method of the ActionForm."

The book 'Programming Jakarta Struts' says following about the reset() method:

"For an ActionForm that has been configured with request scope, the framework will create a new instance for each new request; hence, there's not much need to reset the values back to any default state. <b>ctionForms that are configured with session scope are different, however, and this is where the reset() method comes in handy</b>."

Which one is correct?

Thanks
KK
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
'Programming Jakarta Struts' is right.. the other is wrong. The fact that the the reset() method is called when the ActionForm is in session scope is easily verifiable.
 
Kevin Kumar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Merrill. I'll follow the Programming Jakarta Struts book.
 
reply
    Bookmark Topic Watch Topic
  • New Topic