Your question would be better sent to the webwork mailing list but here goes. Visitor allows you to centralize the validation for a single class in a single file. Why would this be useful? Suppose you have two actions, CreateGame and UpdateGame. They are responsible for creating and updating instances of com.eg.Game. The default webwork validation files would be org/eg/CreateGame-validation.xml and org/eg/UpdateGame-validation.xml. Without visitor validation you would be forced to repeat your validation logic in both files. However, suppose in both actions your Game is accesible via getModel() (ie your action implements ModelDriven). In this case you can simply use
in both files. This validator checks the type of model and then looks for validation files matching its class hierarchy. So in this case assuming Game implements no interfaces and extends no classes it would execute the validation in org/eg/Model-validation.xml. If the instance returned by getModel() is of type Monopoly (extending Game) it would execute the validation in both org/eg/Game-validation.xml and org/eg/Monopoly-validation.xml.