This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Validation.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Validation.xml" Watch "Validation.xml" New topic
Author

Validation.xml

somin bhuvan
Greenhorn

Joined: Jun 01, 2005
Posts: 22
Hi,

I have a ActionForm which contains 3 attributes like:-

Phone, Email, Credit Card

Validation.xml contains validation for above attributes.
My Page behaves kind of pagination,

In 1st Page it has only Phone
In 2nd Page it has Email and Credit Card

While i validate for 1st Page; the other two validation also comes into the first page as those validation are done in Validation.xml. I dont know how to neglect the other two validation at run time for the first Page. Please help me.

Regards,
Bhuvan
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
Look at this link for info on using the page attribute: http://struts.apache.org/1.2.4/userGuide/dev_validator.html

Multi Page Forms

The field element has an optional page attribute. It can be set to an integer. All validation for any field on a page less than or equal to the current page is performed server side. All validation for any field on a page equal to the current page is generated for the client side Javascript. A mutli-part form expects the page attribute to be set.

<html:hidden property="page" value="1"/>

I will admit that I do not use this technique. I think it requires you to use session scope for your forms because when validation runs for page 2 it expects the values from page 1 to be populated. I have normally not used the validator framework for wizard pages and just implemented the validate method myself.

- Brent
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Validation.xml
 
Similar Threads
build a list page?
Struts conditional/dependent validation
servlet and javascript
Validation.xml
Problem in Validating array of form field