users@jersey.java.net

[Jersey] Re: Bean validation with Jersey 1.2

From: Nasir Rasul <nasir.rasul_at_gmail.com>
Date: Wed, 15 Mar 2017 07:17:00 -0600

Hi Sajin
You should be able to simply include the jar, use the annotation and call
the validate method. It does require an extra call and not as convenient as
using @Valid.

I haven't tried doing, so not sure if you may run in dependency issues.

Regards
Nasir

- Nasir

On Sun, Mar 12, 2017 at 3:08 PM, Sajin Balakrishnan <
sajin.balakrishnan_at_gmail.com> wrote:

> Thanks Pavel.
> Is there any alternative in Jersey 1.x to achieve bean validation before
> POST or PUT happens?
>
> On 12-Mar-2017 9:04 PM, "Pavel Bucek" <pavel.bucek_at_oracle.com> wrote:
>
>> Hi Sajin,
>>
>> Jersey 1.2 does not support bean validation.
>>
>> I was curious myself whether that could be possible; Jersey 1.2 was
>> released on May 20th, 2010 and Bean validation API 1.0.0 on Oct 2009, so it
>> is, unfortunately the first integration I know of was for JAX-RS 2.0,
>> released as part of Java EE 7.
>>
>> You could try to port related code from Jersey 2.x to Jersey 1.x, but
>> migrating your app to supported Java version seems like better time/money
>> better spent.
>>
>> Regards,
>> Pavel
>>
>>
>> On 11/03/2017 12:14, Sajin Balakrishnan wrote:
>>
>>> For one of our legacy java 1.5 application we are stuck with Jersey 1.2.
>>>
>>> Does jersey 1.2 support JSR-303 bean validation.
>>> If not how to provide bean validations?
>>>
>>
>>