dcsimg
How to get JAXB validation to tell me which field is wrong?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Alwyn_Teh
Posted On:   Friday, January 27, 2006 01:40 PM

I'm using JAXB 1.0.5 obtained from within JWSDP 1.6 from Sun. I have tried the javax.xml.bind.Validator with the DefaultValidationEventHandler, and also my own javax.xml.bind.ValidationEventHandler with handleEvent() passed in a javax.xml.bind.ValidationEvent...etc. When creating an JAXB object for marshalling, and Validator.validate() is called, sometimes, I get error messages like: a required field "ProductId" is missing an object. Then, other times I get: the value does not match the regular expression "([0-9]+,([0-9]))*" which isn't very helpful as it doesn't say which field the error message relates to. Does anybody know how to get JAXB to be more precise and say wh   More>>

I'm using JAXB 1.0.5 obtained from within JWSDP 1.6 from Sun.

I have tried the javax.xml.bind.Validator with the DefaultValidationEventHandler, and also my own javax.xml.bind.ValidationEventHandler with handleEvent() passed in a javax.xml.bind.ValidationEvent...etc.

When creating an JAXB object for marshalling, and Validator.validate() is called, sometimes, I get error messages like:
a required field "ProductId" is missing an object.

Then, other times I get:
the value does not match the regular expression "([0-9]+,([0-9]))*"
which isn't very helpful as it doesn't say which field the error message relates to.

Does anybody know how to get JAXB to be more precise and say which field is wrong?

   <<Less
About | Sitemap | Contact