You can write validate method while extending ValidatorForm. But it will become same as that of extending ActionForm.
ValidatorForm class extends ActionForm and provides basic field validation based on an XML file. The key passed into the validator is the action element's 'name' attribute from the struts-config.xml which should match the form element's name attribute in the validation.xml.
ValidatorForm used for declarative validations not for programatic validations.
I have written the code for checking from database. In this code if the email id already exists in the database, it is not storing once again but the error message is not displayed and also i have tried by using logic tag. Both the scenarios are not working.How to solve the problem.
ResultSet rs=st.executeQuery("select emailid from registration where emailid='"+emailid+"'");