It's not a secret anymore!
The moose likes Struts and the fly likes validate() and execute() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "validate() and execute()" Watch "validate() and execute()" New topic

validate() and execute()

Abhi Agar

Joined: Jun 15, 2010
Posts: 26


My question is: what runs first in a struts action class which extends ActionSupport - execute() or validate()?

It's the belief in the power of your dreams that counts! (SCJP 5.0, SCWCD 5.0)
David Newton

Joined: Sep 29, 2008
Posts: 12617

Depends on your interceptor stack--validate() only runs if you have the validation interceptor.

It wouldn't make any sense to run execute() *before* validation, though, would it, since the workflow interceptor determines which result should be returned on a validation interceptor.
I agree. Here's the link:
subject: validate() and execute()
It's not a secret anymore!