users@jersey.java.net

Re: [Jersey] validation???

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Tue, 12 May 2009 13:40:15 +0200

On May 12, 2009, at 12:58 PM, Felipe Gaścho wrote:

> Here it is an example on how Microsoft do that:
> http://www.codeproject.com/KB/WCF/WCFVAB.aspx
>
> I was forced to work with .Net technologies last year and despite my
> personal preferences I should recognize .Net framework has a
> comfortable mechanism for validation...
>
> In Jersey I would say that using annotations would be a natural
> choice, something like:
>
> @Validate(param="value", validator="ValidClass.class")
> public void operation(int value)
>
> the suggestion to create a type and use it in the service context is
> also not bad..
>
> * these are raw observations, suggestions and wish list only..
>

What you describe may be supported by the Bean Validation Framework
(JSR 303):

http://in.relation.to/Bloggers/BeanValidationJSR303PublicDraftGiveUsFeedback

Paul.

> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>