Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

prevent validate running the the first time 1

Status
Not open for further replies.

maxpower1

Programmer
Jul 29, 2001
488
US
somehow, my validate() function from ActionForm runs the first time form is loaded. How can I turn this off so that the validate() function only runs when a user clicks on the submit button?

thanks

~za~
You can't bring back a dead thread!
 
Hi,

There is a way around to it. You need to create a DummyAction class which exteds Action. Onload of all the forms in the Presentation Layer can call this DummyAction for which the Validation is set to false. Once it is submited it will check for the validation and then to the ActionClass.

<action path=&quot;/testAction&quot; type=&quot;org.apache.struts.action.Action&quot;>
<forward name=&quot;success&quot; path=&quot;/view.jsp&quot;/>
</action>

Then your View.jsp action mapping will have the validation to true.

Hope this will help you.

Cheers,
-Venu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top