Jersey 如何通过和阅读&;在@QueryParam Jax-RS中
我有一个Rest服务接受QueryParam,其中的值有&以及如何传递它并将其作为查询参数接受 这里我附上我使用的源代码。 我也打电话给你Jersey 如何通过和阅读&;在@QueryParam Jax-RS中,jersey,jax-rs,query-parameters,Jersey,Jax Rs,Query Parameters,我有一个Rest服务接受QueryParam,其中的值有&以及如何传递它并将其作为查询参数接受 这里我附上我使用的源代码。 我也打电话给你 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\&
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)
}
您需要对url进行如下编码:
http://localhost:7001/Rest/GetInfo?type=J%26Y