users@jsr311.java.net

Re: PathSegment question

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Mon, 01 Dec 2008 11:42:07 -0500

On Dec 1, 2008, at 5:43 AM, Sergey Beryozkin wrote:
>
> If we have say a request URI "/bar" then should
> PathSegment.getPath return "bar" or "/bar" ?
>
"bar"

> Or, similarly, if we have "/" then should it be "" or "/" ? The
> latter seems right so should it be "/bar" for PathSegment.getPath
> for "/bar" URI ?
>
It should be "".

> PathSegment JavaDocs do not give any examples hence I'm asking here,
> I'd go for "/bar" for PathSegment.getPath without troubling the
> list, but it seems somewhat inconsistent with how @PathParam
> presents the values captured by default regular expressions (that
> is, without the '/') - hence I'd like to clarify
>
No problem. There shouldn't be a leading '/' in either case.

Marc.

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