I'm not sure if this is good way to do it, but it is the approach that I've taken:


1. Make a utility class to wrap commons-validator to deal with:

      loading a validator config
      init and run the validator
      check the validator for errors

2. On a per action basis:

      make an instance of the utility class
      pass in :
        ruleFile (String),
        formBean (JavaBean),
        formName (String),
        errorMsgs (Hashtable)
      and get a boolean back indicating whether there were errors or not

What this allows me to do, is to split my validator config files if I want.
From a resource perspective, this is expensive, but I was not ready to
look at how to implement a service for this.


Wayne



Henning P. Schmiedehausen wrote:

"Mark Lybarger" <[EMAIL PROTECTED]> writes:

I admit that I've looked at the validator some time ago and then it
looked to me like one big kludge. I don't know whether this has
changed (this was long before the first validator release) but the
fact that it seems to have been a part of Struts suggests, that it
should be stable and proven.

I don't know if someone has already combined commons-validator and
Turbine but I would be interested in code examples.

        Regards
                Henning



doh, sorry. s/commons-logging/commons-validator





-----Original Message-----
From: Mark Lybarger Sent: Tuesday, July 06, 2004 10:11 AM
To: 'Turbine Users List' (E-mail)
Subject: commons-logging with turbine



We're interested in using commons-logging flexability with our turbine applications. We're currently using intake for validating our form information, but need more robust validation (cross field validations, etc). Is the validator easily swapable? Is there documentation/experience out there of easily using the commons-validator (or a derivitive) with turbine? Our velocity templates would also need to easily identify if a particular field is valid or not... thoughts? suggestions?




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









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








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



Reply via email to