I struggled with the same thing, and finally had to defer to the "Webwork in Action" and it's chapter on the Validation Framework.

"In the case of multiple action aliases, it's a better idea to pull your common validations into a method and then call that method from each of your execute() equivalent methods."

So instead of overriding validate(), I have several validation() methods [action1Validation(), action2Validation)(), etc) and calls those first off, as needed.

ironic wrote:
I have a class that services many actions. For each action that needs validation I have a corresponding Class-action-validation.xml, which takes care of the simple validation. However, I have a case where two actions need more complex validation (handled in Struts 1 by validwhen and indexedproperty validators), and I've overridden the validate() method in an attempt to handle this. The problem now is that I need to work out which action caused the validate() method to be called. How can I determine this? Alternatively, is there a way to direct an action to a validate method that is intended only for that action? For example, actionA would cause method validateActionA() to be called. Any hints, pointers or help would be greatly appreciated.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to