File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes ActionForm method call sequence Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "ActionForm method call sequence" Watch "ActionForm method call sequence" New topic

ActionForm method call sequence

wrushasen dakhane
Ranch Hand

Joined: Sep 25, 2006
Posts: 47
Hi ,

Can anybody tell the sequence of the methods that are called when any new request come and the ActionForm gets pouplated?

And also when the form which is already in session then in that case what will be the sequence.

I am little confuse in this.


SCJP 1.4, SCWCD 1.4
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Here is the sequence of events as I understand them.
  • Check to see if there is an existing bean in the declared scope. If no bean exists, instantiate one ant put it in the declared scope
  • Call reset()
  • Evaluate the contents of the request and call setter methods on the bean as necessary
  • If the action mapping specifies validate="true" call validate()

  • [ April 13, 2007: Message edited by: Merrill Higginson ]

    Consultant, Sima Solutions
    wrushasen dakhane
    Ranch Hand

    Joined: Sep 25, 2006
    Posts: 47
    What if the form bean doesn't already exits in the scope?

    Will the reset() method will get called on that?
    Brent Sterling
    Ranch Hand

    Joined: Feb 08, 2006
    Posts: 948
    I am pretty sure that reset will always get called. I use request scope 99% of the time so I seldom ever (never?) write a reset method.

    - Brent
    I agree. Here's the link:
    subject: ActionForm method call sequence
    It's not a secret anymore!