aspose file tools*
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
Author

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.

Wrushu


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 ]

    Merrill
    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: http://aspose.com/file-tools
     
    subject: ActionForm method call sequence