Hi Martin, I have already submitted changes to the Castor group with this and another minor enhancement to the ValidationException. I made this submission in Feb 2002. I am still waiting for my changes to be committed (or feedback on how it can be improved so that it can be committed).
I started this thread on Jan. 3 and the subject line was "XML Schema Validation: returning the field name in the exception" I could send you a .jar of 14 classes that I've had to modify to get the desired effect. However, these changes were based on the Castor 0.9.3.9 FTP code (current code in Feb 2002). They are mostly validator classes because these are the places where ValidationException is being instantiated due to incorrect user input. I've basically changed the code so that my new ValidationException constructors are called instead and that's where most of my new fields are set. You'll be able to see the effect of my changes by catching the ValidationException and printing it. In the same catch block, you could use the new getters I've put on ValidationException for fieldName, errorKey, fieldValue, etc. for whatever specific error handling you require. Good luck and let me know how you like it. Regards, Joyce : ) --- Martin Lang <[EMAIL PROTECTED]> wrote: > Hi, > > it seems that the Validators for simple types like > long or string do not > report the name of the field for which the > validation did not succeed. > In such cases I only get a message like > "0 is lower than the minimum allowed value of 1" > which makes is very > difficult to find out what is really wrong. > > Does anybody know a workaround. > > Martin > > ----------------------------------------------------------- > > If you wish to unsubscribe from this mailing, send > mail to > [EMAIL PROTECTED] with a subject of: > unsubscribe castor-dev > ______________________________________________________________________ Post your ad for free now! http://personals.yahoo.ca ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev
