0

I would like to intercept the request/response query param, how can I do that using jersey?

Something like for JSON:

@Provider
public class ObjectMapperContextResolver implements ContextResolver<ObjectMapper> {
    //...
}

Bean Param:

 public class FooQueryParam {
        @QueryParam(value = "color")
        private Color color;

        public Color getColor() {
            return color;
        }

        public void setStatus(Color Color) {
            this.color = color;
        }
    }

The resource:

public Response get(@BeanParam FooQueryParam fooQueryParam) {
            //... 
}
richersoon
  • 4,682
  • 13
  • 44
  • 74
  • Are you asking this question because you are still trying to fix the [same problem](http://stackoverflow.com/q/33357594/2587435)? – Paul Samsotha Oct 27 '15 at 06:29
  • Nope, this is another issue.. I want to intercept the QueryParam then check the instance then convert into something – richersoon Oct 27 '15 at 06:30
  • For general filtering, you can see [Filters and Interceptors](https://jersey.java.net/documentation/latest/filters-and-interceptors.html). But if conversion is the goal, then the javadoc for `@QueryParam` explains the ways for conversion. The only non-obvious way is through a `ParamConverterProvider`. You can see an example [here](http://stackoverflow.com/a/32677962/2587435) – Paul Samsotha Oct 27 '15 at 06:36

0 Answers0