users@jsr311.java.net

Re: _at_PathParam(...) PathSegment ps

From: Bill Burke <bburke_at_redhat.com>
Date: Tue, 03 Jun 2008 16:49:19 -0400

My mail client cannot grok your post.

Marc Hadley wrote:
> 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.
>
>
> ------------------------------------------------------------------------
>
> Option T
> String List<String> PathSegment List<PathSegment>
> (a) “1/2/3” [“1/2/3”] “1/2/3” [“1/2/3”]
> (b) “1/2/3” [“1/2/3”] “3” [“1”, ”2”, ”3”]
> (c) “3” [“1”, ”2”, ”3”] “3” [“1”, ”2”, ”3”]
> (d) “3” [“1”, ”2”, ”3”] “1/2/3” [“1/2/3”]
>
>
>
>
>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jsr311.dev.java.net
> For additional commands, e-mail: users-help_at_jsr311.dev.java.net

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com