I added this test case :

@GET

@Path("/booksquery")

public Book getBookByQuery(@QueryParam("id") String id) {


String[] values = id.split("\\+");

StringBuilder b = new StringBuilder();

b.append(values[0]).append(values[1]);

return books.get(Long.valueOf(b.toString()));

}

GET http://localhost:9080/bookstore/booksquery?id=12%2B3

Also added a similar test

@GET

@Path("{id}")

public Book getBookById(@PathParam("id") String id) {}


handling GET http://localhost:9080/bookstore/id=12%2B3



All works fine on 2.2-SNAPSHOT (will work the same in 2.1.x shortly)



Have I misundestood your request ? You're not using query

Hi,

There's currently an issue with handling encoded URIs but it's been just fixed in 2.2-SNAPSHOT and will be merged shortly to 2.1.x branch.

Just wouild like to clarify that this is a sample request URI :

/foo/bar=A%2BB

can you please tell me how are you retrieving the bar value ?
is it like this :

@Path("/foo/{barPair}")
someMethod(@PathParam("barPair") String bar)

Thanks, Sergey


Hi,

I might have a problem with URL escaping +.

Assuming I want to call a JAX-RS service foo with parameter bar and the value "A+B". A + in a URL is a space so we need to escape it with %2B. If I have the URL /foo/bar=A%2BB then the service method should get the String "A+B". It however will get the string "A B". If escape %2B again and use the URL /foo/bar=A%252BB then the method will receive the String "A+B". Is this is a feature or is there some defect that causes this?

Regards,
Lasse


Reply via email to