Re: JSR311: Questions

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Mon, 26 Nov 2007 16:31:59 -0500

On Nov 25, 2007, at 6:28 PM, Arjen Poutsma wrote:
> I've been reading through the Editors Draft version of the spec,
> dated October 3rd. Generally, I like what I see, but I have a couple
> of questions. I hope these haven't been asked before, I am only a
> recent member of the list.
> * I wonder if value of the @Path annotation (or @UriTemplate, as
> called in the spec) is meant to express an URI path according to RFC
> 3986, section 3.3? Or can it also contain query and/or fragment
> values? The recent name change seems to suggest the former.
The former is what I had in mind.

> * The regular expression mentioned in section 2.6.1 ({\([w-\._]+?
> \)}) confuses me. For one, according to the Pattern Javadoc, \w
> already includes _, so it is unnecessary to include it explicitly.
> Also, the URI Template draft mentions that variable names can be RFC
> 3986 unreserved characters, so that would include ~. And the { and }
> characters are not escaped, while the ()'s are. A more correct
> regular expression would be \{([\w-\.~]+?)\}, I think.
Yes, you are right, I'll fix this in the next rev of the spec.

> * The algorithm in section 2.6 does not mention "unlimited"
> resources (i.e. @Path(value="{widgets}, limited=false). If I
> understand correctly, the last sentence of step 1(b) needs to change
> into something like "If the resource class is limited then append
> '(/)?' to the resulting regular expression, if not then append
> '(/.*)?'.
Right. Section 2.6 needs a bit of an overhaul to fix a couple issues
including this one.


Marc Hadley <marc.hadley at>
CTO Office, Sun Microsystems.