1 Reply Latest reply on Apr 20, 2010 9:46 AM by Jozef Hartinger

    Seam3 + RestEasy + Beans Validation Support Idea

    Salahuddin Chalermthai Newbie
      AFAIK, Spring3 has Beans Validation support which is an important and still a missing feature in JAX-RS. Please see the example below

      @RequestMapping(method=RequestMethod.POST)
           public String createNewUser(@Valid User user, BindingResult results)  {

                   if (results.hasErrors()) {
                         return "error";
                   }
                   return "created";
              }

      Currently, there is no clean way to do the same thing with Seam + RestEasy Integration.

      Yes, I know I can still use XML Schema to perform validation.
      But troubles will happen when I'm not consuming XML but JSON documents instead, and needed to perform some validation over them.

      Maybe this isn't a Seam issue but a JAX-RS/RestEasy issue, I'm not sure.

      Anyway, Seam3 can step further to present a way to handle violated constraint cases separately by using Seam/CDI event model.

      My 2 cents. What about yours?

      Cheers!