Question

I have a Rest Service accepting QueryParam and the value has & in it and how do i pass it and accept it as a Query Param.

Here i am attaching the source i used. i am calling the same by

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)
    }
Was it helpful?

Solution

You need to encode your url like: http://localhost:7001/Rest/GetInfo?type=J%26Y

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top