2014-02-14 61 views
1

我有一個Rest服務接受QueryParam,其值爲&,我如何通過它並接受它作爲查詢參數。如何通過閱讀@QueryParam Jax-RS

在這裏,我附上我使用的來源。 我被

http://localhost:7001/Rest/GetInfo?type=J&Y 
as & is the seperator its taking only till J. 
if i use "\" then its not working. 
http://localhost:7001/Rest/GetInfo?type=J\&Y 

    I am deploying on Weblogic. 

    @GET 
    @Path("/GetInfo") 
    //@Produces("text/javascript") 
    @Produces("application/json") 
    public String getInfo(@QueryParam("type") String type) 
    { 
      // i am reading the type here 
      if(type != null 
       getUserType(type) 
    } 

回答

1

調用同一個你需要編碼您的網址,如: http://localhost:7001/Rest/GetInfo?type=J%26Y