users@jersey.java.net

[Jersey] Issue while trying to apply _at_Provider annotation conditionally.

From: Navin Desai <ndesai_at_tagworldwide.com>
Date: Wed, 23 Jan 2013 15:47:12 +0000

Hi,
We have a spring - jersey app. We are using the @Provider annotation to configure a JacksonJsonProvider. This works fine. But our requirement is to configure it only for a few selected environments (e.g. dev, qa, live, staging) but not for all.

We have achieved environment based configuration in our project using spring bean profiles. But the @Provider annotation bypasses spring bean profile.

Code example for the provider.
@Provider
@Produces(MediaType.APPLICATION_JSON)
public class JacksonJsonProvider extends JacksonJaxbJsonProvider {

Is there a way to configure this based on environments or conditionally apply the @provider annotation in way?

Thanks!

Regards,
Navin.

This e-mail has been scanned for all viruses by Star.