File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes validation problems with multipage form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "validation problems with multipage form" Watch "validation problems with multipage form" New topic

validation problems with multipage form

Ji Won

Joined: Jul 04, 2004
Posts: 3

I'm having issues using the validator framework. I have a DynaValidatorForm with a bunch of form-properties, including a "page" initialized to "1" of type java.lang.Integer
Without validation, things seem to work flawlessly. I have the form spread over 3 jsp pages (each with a hidden "page" property), each submitting to a different action.

Using the validation is a bit tricky.

When I validate just the first page, it works perfectly. I have the fields on the first jsp defined in the validation.xml page.
But when I try to add a "page" attribute to the field tag, the first page won't validate (I haven't even gotten to the second or third pages).

I refactored my code to use DynaValidatorActionForm, using the action path as the formname in validation.xml and in the html:javascript tag on my jsp pages. This was unsuccessful as well.

Can anyone give me some insight? Thanks!
Ji Won

Joined: Jul 04, 2004
Posts: 3
I finally got the multipage validation to work.

Apparently the hidden page property in the jsp isnt' enough; you need to specify the page in the javascript tag as well.
I agree. Here's the link:
subject: validation problems with multipage form
It's not a secret anymore!