Hi,
Seems that I'll have to wait for jax-rs 2.0 implementation: (from
http://markmail.org/message/wgm3hj3rrva3j6jo?q=list:net.java.dev.jsr311.dev#query:list%3Anet.java.dev.jsr311.dev+page:1+mid:wgm3hj3rrva3j6jo+state:results)
"JAX-RS 1.1 has limited support for parameter validation. This JSR
will make it possible to validate a set of parameters, such as form or
query parameters, and to return a meaningful response in case
validation fails. The primary API utilized for validation will be the
Bean Validation API. "
Regards,
Nicolas Griso
On Thu, Nov 11, 2010 at 3:45 PM, Nicolas Griso <nicolas.griso_at_gmail.com> wrote:
> Hello,
>
> I'd like to know if there is in jersey-server a support for javabean
> validation (jsr 303) for method receiving data in Resource classes?
> (I searched but I haven't found anything)
>
> For example, Spring MVC is supporting something like this:
> @Controller
> public class MyController {
> @RequestMapping("/foo", method=RequestMethod.POST)
> public void processFoo(@Valid Foo foo) { /* ... */ }
>
> Example from: http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/validation.html#validation-mvc
> Method parameters can be annotated with @Valid (annotation from the
> jsr303) which makes Spring validated the data before calling the
> method.
>
> What do you think of this?
> Can something similar be implemented in jersey-server?
>
> Thanks a lot.
> Nicolas Griso
>