users@jax-rs-spec.java.net

[jax-rs-spec users] [jsr339-experts] Desired behavior of UriBuilder.fromResource

From: Jan Algermissen <jan.algermissen_at_nordsc.com>
Date: Thu, 8 Nov 2012 09:59:15 +0100

Before I file a ticket, let me ask here:

Suppose I have:

@Path("customer/{id}")
public class CustomerResource {


When I use UriBuilder.fromResource(CustomerResource.class)

The builder creates a URI, %-encoding the { and } in the path.

This sort feels both, wrong and correct :-)

Question: what is the desired behavior?

And: would it make sense to *NEVER* encode the template variable chars when using fromMethod() and fromResource() because when using these two methods, the encoding *never* makes any sense?

IOW, there cannot, IMO, be a case ever where the caller *does* want them encoded.

Thoughts?

Jan