users@jsr311.java.net

RE: Re: PathSegment question

From: Sergey Beryozkin <sberyozk_at_progress.com>
Date: Fri, 5 Dec 2008 06:10:09 -0500

Ok, it's understood. The quality of the javadocs is actually very high
indeed - thanks for putting a lot of effort into writing them

Sergey

-----Original Message-----
From: Marc.Hadley_at_Sun.COM [mailto:Marc.Hadley_at_Sun.COM]
Sent: 04 December 2008 19:22
To: users_at_jsr311.dev.java.net
Subject: Re: PathSegment question

On Dec 4, 2008, at 11:14 AM, Sergey Beryozkin wrote:
>
> Suppose we have
>
> @GET @Path("bar{foo:.+}")
> public String get(PathParam("foo") PathSegment ps,
> PathParam("foo") String s) {}
>
> GET /bar/foo/baz
>
> the value of the second paramater is "/foo/baz"
>
> what is value of ps.getPath() ?
>
> should it be 'foo' or 'foo/bar' ?
>
It should be 'bar'. See the javadoc of @PathParam: "the value will be
the final segment of the matching part of the path".

A type of List<PathSegment> can be used to get ['foo', 'bar'].

Marc.

>>

---
Marc Hadley <marc.hadley at sun.com>
CTO Office, Sun Microsystems.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jsr311.dev.java.net
For additional commands, e-mail: users-help_at_jsr311.dev.java.net