This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I am doing struts validation server side. How do I by pass validation during runtime, because I have 2 buttons on the same form. One is accept and another is save. When I click save it should by pass validation during run time.
There is nothing in struts that requires that you do validation. When you click the submit button, the framework will call the ActionForm.validate method. You need not override that method at all and no validations will be done. The method will still be called on the parent class, ActionForm, but it will never return any errors.
Just now found the answer of how to by pass validation in struts. To allow the user to cancel the submit and bypass the validations, a flag can be set. If the Submit button sets bCancel to true, then the Struts Validator will pass control through to the Action.
PS: The "click" was mis-spelled debilrately. But in real coding do spell it in the proper way.