Quick question on Form validation, using the Automatic Validation
offerred by Struts.
If i have a form bean which performs some validation on the validate
method, and an action has it's definition of validate set to true, then
the Form Bean's validate method gets called before the action's perform
method. However, this then displays my error messages on the form page
the first time i go to the page ! Am I missing something ?
Now i can get round this with some checking in the validate method to
ignore it the first time round - as there will be no data yet. As i
understand, the bean is created if it isnt found. So if it's just been
created, and then the validate method is called of course there will be
nothing there ?
Any suggestions ? Or does someone want to point out the obvious ?!
In our Struts implementations to date, we have avoided using this
feature and done our validation from within the Action. But I am
investigating this feature and would like to know why this is so / what
i am doing wrong !
Many thanks
G