I have a 'MyForm' link on the menu of my page which brings up a form when clicked. I have implemented validate method in the above form class...... When a form is submitted, validate method checks for the null or empty fields and prompts the user the enter the fields if they are not entered, giving them the error messages. But the problem is, when the user cliks on the 'MyForm' twice, ie without filling the form, if the user clicks the link, then it is calling the validate method and displaying all the error messages.... How do I avoid to display the validation errors when the user clicks on the link again. I cannot remove the hyperlink on 'MyForm', when the user is already on that page, because I am creating the menu buttons in another taglib, at the beginning of the JSP...so I have no way of knowing in which page the user is... How do I know in my form java class that the user has not submitted the form, and treat it like a fresh request, when the user clicks on the link again??
I use Struts extensively, and I code it such that there are two action mappings to the same Action subclass and form, with the difference being that one has validate="true", and the other validate="false". Maybe this would apply to your situation?