| Author |
Page attribute in validator
|
Shruthi Babu
Ranch Hand
Joined: May 04, 2007
Posts: 54
|
|
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
|
 |
Brent Sterling
Ranch Hand
Joined: Feb 08, 2006
Posts: 948
|
|
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
Joined: May 04, 2007
Posts: 54
|
|
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?
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
"rohi27", Please check your private messages. -Ben
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
 |
|
|
subject: Page attribute in validator
|
|
|