users@jsr311.java.net

Re: _at_PathParam(...) PathSegment ps

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Tue, 03 Jun 2008 16:43:54 -0400

Attached is a HTML table that outlines what I see as the possible
values of var depending on type T in:

@Path(value="{var}" limited=false)
public class SomeResource {
   @GET
   public SomeType get(@PathParam("var") T var) {...}
}

for a request

GET /1/2/3.

As pointed out earlier in the thread, options (a) and (d) don't really
work for PathSegment since that is designed to represent a single path
segment rather than multiple. IMO, option (c) gives a surprising
result for String which really only leaves option (b) as viable.
Option (b) is a bit odd since the results are quite different
depending on the type T but its already the case that PathSegment is
special (it extracts the whole path segment even if the referenced
template variable has adjacent literal characters) so I think I can
live with that.

Thoughts ?
Marc.

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