Using @Consume with GET request in Jersey Rest

后端 未结 5 640
夕颜
夕颜 2021-02-10 16:05

I\'m trying to bind values in a GET request to a POJO.

The values are parameters in a HTTP GET request. I\'m using JSONP to pass the parameters however it looks like JS

5条回答
  •  星月不相逢
    2021-02-10 16:36

    I was able resolve this by using @com.sun.jersey.api.core.InjectParam of jersey

    public JSONWithPadding doSomething(@InjectParam final MyPojo argPojo) 
    

    Then the Pojo looks like this

    public class MyPojo 
    {
    /** */
    @QueryParam("value1")
    private String value1;
    
    /** */
    @QueryParam("value2")
    private String value2;
    
    /** */
    @QueryParam("value3")
    private List value3;
    

提交回复
热议问题