Jax Rs:ContextResolver <objectmapper>类似于使用@BeanParam的QueryParam

时间:2015-10-27 05:55:48

标签: java spring java-ee jersey jax-rs

我想拦截请求/响应查询参数,我该如何使用泽西?

类似于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;
        }
    }

资源:

public Response get(@BeanParam FooQueryParam fooQueryParam) {
            //... 
}

0 个答案:

没有答案