dev@jsr311.java.net

Questions

From: Arjen Poutsma <arjen.poutsma_at_springsource.com>
Date: Mon, 26 Nov 2007 00:28:18 +0100

Hi,

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 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.

* 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 '(/.*)?'.

I hope that someone can shed some light on these issues.

Thanks,
Arjen

---
Arjen Poutsma
SpringSource
E: arjen.poutsma_at_springsource.com
W: www.springsource.com
B: blog.springsource.com/arjen