users@jsr311.java.net

Re: Matching requests to subresource methos

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Fri, 07 Mar 2008 09:51:34 -0500

On Mar 7, 2008, at 8:42 AM, Sergey Beryozkin wrote:
>
> I have few questions about matching requests to subresource methods.
>
> Consider this class :
>
> @Path("/")
> class SomeClass {
>
> @GET
> @Path("bar")
> public Bar getBar() {}
> }
>
> Is it correct that a "GET /bar/" request won't be bound to getBar() ?
>
> According to the 2.5 section, the trailing '/' in GET request will
> end up in the final matching group, when matching it against
> Path("bar"), and thus according to 2.5.2.d, getBar() won't be
> included in the list of candidates...
>
In 2.5.2.d you remove members for which the final matching group is
not empty or '/'. So if the final matching group is '/' then you'd
you'd leave it in.

Marc.


>
> Did I get it wrong ?
>
> Thanks, Sergey
>
>
> ----------------------------
> IONA Technologies PLC (registered in Ireland)
> Registered Number: 171387
> Registered Address: The IONA Building, Shelbourne Road, Dublin 4,
> Ireland

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