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?
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.
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?
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" <[hidden email]> wrote:
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.
On Sun, Mar 12, 2017 at 3:08 PM, Sajin Balakrishnan <[hidden email]> wrote:
Jersey 1.x has a class called "RequestDispatcher , registrable by registering provider ResourceMethodCustomInvokerDispatchProvider", which is invoked before the actual resource method invocation happens. It has access to java.lang.reflect.Method and AbstractResourceMethod (part of Jersey model), and I believe that you could be able to relatively easily plugin BV into your chain by implementing that.
On 15/03/2017 14:17, Nasir Rasul wrote:
Thanks Pavel and Nasir.I will try this out
On 15-Mar-2017 2:41 PM, "Pavel Bucek" <[hidden email]> wrote:
|Free forum by Nabble||Edit this page|