wood burning stoves 2.0*
The moose likes Struts and the fly likes Form Validation and Delete using struts 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 "Form Validation and Delete using struts" Watch "Form Validation and Delete using struts" New topic
Author

Form Validation and Delete using struts

rahul V kumar
Ranch Hand

Joined: May 20, 2003
Posts: 82
I have a web page which has few form fields.
These form fields are populated with some data based on the user logon on.
i have two buttons. Button 1 is "Save"
and Button 2 is "Delete"
Both these buttons call the same ActionServlet.
If the user clicks "Save", I have to verify that all the fields are entered and then I have to save the data to persistent store. If the user selects "Delete" then I shouldn't be checking the data in the form fields and should delete the data from the persistent store.
I know the validation could be performed using validate method in ActionForm class.
Question 1) When the user hits the "Delete" button will the validate method be called.
If so how can i avoid calling the validate method.
Thanks in advance
rahul V kumar
Ranch Hand

Joined: May 20, 2003
Posts: 82
I found a way out for this one.
I was setting the form action based on the button selection
and it helped me resolve this issue
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Form Validation and Delete using struts
 
Similar Threads
LookupDispatchAction + html:cancel
intermediate submit and validation of a form
Validations using ActionErros Validate
Apache Commons Validation Framework
JSF validation components !!