• 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

Page attribute in validator

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a form which is used by 2 jsps say A.jsp and B.jsp

There are validation for 3 fields for A.JSP whereas I need to validate only one of them for B.jsp.

How to handle this in validation.xml? Should I do something with the page attribute.

Any help is highly appreciated
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The page attribute seems to be designed for wizard type pages where the form is saved in session. It validates all fields where the page is equal to or less than the current page. I don't think that will work for you.

If your version of Struts supports it, then there is the validwhen rule that you might be able to use (I am still using 1.1 which does not support validwhen). There is always the fall back of implementing the validate method yourself or you might be able to use ValidatorActionForm which applies validation rules based on the name of the action instead of the name of the form.

- Brent
 
Shruthi Babu
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have the form in session .

My problem is

Form A extends Form B

and all the three fields are validated in form form b

But I need to validate only one of the 3 fields in Form A.

How to handle this?
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"rohi27",
Please check your private messages.
-Ben
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic