ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Using the Validator Framework with Struts
Subject:   Field Dependent Processing?
Date:   2003-02-27 17:48:28
From:   anonymous2
I'm using the Jakarta Validator classes to do some validation on my JavaBeans. The problem is that some of the fields in my bean should only be filled in if other fields in the bean are filled in.


For example my bean consists of the fields:


int a;
String b;
String c;


Now a is always supposed to be there so I know how to check for that. Field b is optional, so I don't need to check whether its there or not, I just need to check its type when it is there. However, if b is there, then c has to be there. Is it possible to check for this using the Validator classes? If so, how would I make my rule?


Thanks...
theSparko


1 to 1 of 1
  1. Field Dependent Processing?
    2003-06-26 10:33:48  anonymous2 [View]

1 to 1 of 1