Announcement Announcement Module
No announcement yet.
validation at the data tier Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • validation at the data tier

    I have a bean that is populated in another tier and sent to me via web services. I am responsible for verifying the bean before persisting it. I would like to use spring validation where I will be responsible for calling validate() on the Validator implementation and passing in an Errors implementation to the validate() call. What Errors implementation should I use? Should I create my own?

    Thanks in advance...

  • #2
    I think I've found how to use the validator without the MVC framework:

    BindException validatePersonWebServiceMethod(Person person) {

    Validator validator = new PersonValidator();
    BindException errors = new BindException(person, "target");
    validator.validate(person, errors);
    return errors;

    The only thing I need to do is to work out how to send a BindException via. the webservice. Any suggestions?

    Thanks in advance ...