This is what I do (JAX-RS 1.0, Jersey 1.11):
import javax.ws.rs.core.UriBuilder; System.out.println(UriBuilder.fromPath("/").queryParam("x", "%40").build()); System.out.println(UriBuilder.fromPath("/").queryParam("x", "100%").build());
Expected:
/?x=%2540 /?x=100%25
But the actual conclusion:
/?x=%40 /?x=100%25
What's happening? What is a workaround, if so, how should UriBuilder ?
source share