users@jersey.java.net

[Jersey] Re: Bean Validation -- Activation per HTTP Method?

From: Miles, Eric (CONT) <"Miles,>
Date: Tue, 5 Nov 2013 15:42:29 -0500

I did, nothing was there. I'm pretty good about RTFM as well as getting into source itself.

Thanks,
Eric Miles

From: Marek Potociar <marek.potociar_at_oracle.com<mailto:marek.potociar_at_oracle.com>>
Reply-To: Jersey Users <users_at_jersey.java.net<mailto:users_at_jersey.java.net>>
Date: Tuesday, November 5, 2013 3:35 PM
To: Jersey Users <users_at_jersey.java.net<mailto:users_at_jersey.java.net>>
Subject: [Jersey] Re: Bean Validation -- Activation per HTTP Method?

Have you checked Jersey User Guide?
https://jersey.java.net/documentation/latest/bean-validation.html

Marek

On 28 Oct 2013, at 17:54, Miles, Eric (CONT) <Eric.Miles_at_capitalone.com<mailto:Eric.Miles_at_capitalone.com>> wrote:

This seems like it would be a fairly common issue to have to solve, so I'm surprised I'm not finding much (anything really) on how to apply constraints on a per HTTP method basis. I'm going to pose it here and hope someone has some suggestions for me.

Take an entity that we have constraints on, i.e. @NotNull, etc and we only want to apply them on certain HTTP methods. For instance, an Id field we would want to apply an @NotNull constraint to on HTTP PUT but not an HTTP POST. Or maybe the same entity that is used as a @BeanParam and we'd want the name field (also annotated with @QueryParam) to be @NotNull for POST and PUT but not for GET.

My original thought was to use groups but after some long hard looks at the bean validation spec I don't think that's going to be the way to go. Anything "out of the box" for this kind of support in jersey? Any other ideas? This seems like more of a Jersey item than a JSR 349 item, thus the post here.

Thanks in advance.

Eric

________________________________
The information contained in this e-mail is confidential and/or proprietary to Capital One and/or its affiliates. The information transmitted herewith is intended only for use by the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer.

________________________________________________________

The information contained in this e-mail is confidential and/or proprietary to Capital One and/or its affiliates. The information transmitted herewith is intended only for use by the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer.