Hi, I bumped into a problem when trying to create a resource with uri
http://example.com/foo.bar

There is only a @Path annotation on the class, not on the method.

* Using @Path("foo.bar") also matches fooxbar (The dot stays a dot in
the regexp).
* Using @Path("foo\\.bar") doesn't match much because foo%5C. in the regexp.

After checking the specifications [0] I came up with
@Path("foo{dot:\\.}bar") (fugly!).

In conclusion, I think @Path("foo.bar") is the correct expression, but
the . should be replaced by \. in the regular expression (step 2 under
[1])

[0] https://jsr311.dev.java.net/nonav/releases/1.1/spec/spec3.html#x3-300003.4
[1] https://jsr311.dev.java.net/nonav/releases/1.1/spec/spec3.html#x3-370003.7.3

By the way, when using @Path("foo{dot:\\.}bar"), the resource also
matches foo.bar/anything.  Is there a way to prevent this?

Regards,
Karel

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2431932

Reply via email to