This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Struts and the fly likes Why is struts calling reset??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Why is struts calling reset???" Watch "Why is struts calling reset???" New topic

Why is struts calling reset???

Dennis John

Joined: Jan 30, 2004
Posts: 10
I have a setup action which pre-populates a form and forwards it to a jsp page which displays the form. When the user submits the form it calls validate and if validate fails, reset for my ActionForm gets called before the jsp page is re-loaded.
I have my input attribute set to the same page that displays the form so I thought reset wouldn't get called again since it is part of the same request. The problem is my collection for my optionsCollection tag is going out of scope (or something) and I am getting an exception error.
Can anyone help me figure out what I am doing wrong???
Matthew Phillips
Ranch Hand

Joined: Mar 09, 2001
Posts: 2676
The reset method gets called on an ActionForm before it gets populated with the values from the request. Validate is called after the ActionForm is populated.

Matthew Phillips
I agree. Here's the link:
subject: Why is struts calling reset???
It's not a secret anymore!