Hi Gang,

I was having problems getting validation to work at all.  I've read every post on 
getting it to work, followed all step-by-steps, and nothing would ever do it.  Today I 
yanked all the .jar files out of my lib directory and updated it with the .jar files 
from the latest release version of struts (1.1).  Well... something started to happen 
all right, just not what I expected.

What it looks like its doing is validating my form before its even loaded (execute() 
does not get called, and my print statements in validate() show that super.validate() 
is returning errors.)

What my code is trying to do is:
1) a list of widgets are displayed.  Each widget has a link to an edit page.  There is 
also an add widget option.  Both the edit and the add call the same action with a 
request parameter like addEdit=add or addEdit=edit.

Currently, when either of these links are clicked, I get a 'page cannot be displayed' 
and my log tells me that there was a validation error.  I don't know why validate() is 
being called in the first place, I have no explicit calls to it, and didn't expect it 
to get run until the next form was submitted and my struts-config.xml said 
validate=true.

2) the next step should be that the action builds the form object with either the 
reset() values for an add, or a database-retrieved set of values for an edit.  
Ideally, when this form is submitted, the form should be validated.  If I change my 
validate() method on my form object to return a new ActionErrors(), then things work 
better, but still don't validate.  

I hope this is enough information.  I can post a bunch of code if its not.  I really 
appreciate any and all help, this validation stuff is taking soooo long to get working!

Thanks in advance,
Janice

Reply via email to