• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Validation.xml

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
reply
    Bookmark Topic Watch Topic
  • New Topic