struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Susan Bradeen" <>
Subject Re: validation occuring before form is loaded, why?
Date Tue, 18 Nov 2003 13:32:10 GMT

On 11/17/2003 08:04:21 PM Janice wrote:

> Hi Gang,
> I was having problems getting validation to work at all.  I've read every
> on getting it to work, followed all step-by-steps, and nothing would ever
> 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).
> 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
> There is also an add widget option.  Both the edit and the add call the
> action with a request parameter like addEdit=add or addEdit=edit.

Just keeping it simple,  you've got something like this?

displayWigetsAction (mapping validate=false) --> displayWigets.jsp
user clicks add button or edit link -->
setupAddEditAction (mapping validate=false)  --> addEdit.jsp
user submits form -->
saveAddEditAction (mapping validate=true)


> Currently, when either of these links are clicked, I get a 'page cannot
> 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
> struts-config.xml said validate=true.
> 2) the next step should be that the action builds the form object with
> the reset() values for an add, or a database-retrieved set of values for
> 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
> 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
> to get working!
> Thanks in advance,
> Janice

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message