users@jersey.java.net

[Jersey] URI templates with fragment identifiers

From: Martynas Jusevi?ius <martynas_at_graphity.org>
Date: Mon, 5 Aug 2013 23:10:24 +0300

Hey,

is it possible to have URI templates that include fragment
identifiers, and build URIs from them using base UriBuilder?

For example, when context path is http://localhost:8080/webapp,

getUriInfo().getBaseUriBuilder().path("/persons/{givenName}%20{familyName}#this").build("John",
"Doe")

results in "http://localhost:8080/webapp/persons/John%20Doe%23this".
Notice the escaped hash, which is not desired.

Is there a workaround for this? Or should I be using
UriBuilder.fragment() instead?

Thanks,

Martynas
graphityhq.com