This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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()
Similar Threads
does OracleDriver really precompile a PreparedStatement?
Mapping servlet links with session bound random values
Skip validation when form not submitted
Error on submitting the form
Bypass Struts Validation framework when using LookUpDispatch Action