users@jsr311.java.net

Re: PathSegment question

From: Sergey Beryozkin <sergey.beryozkin_at_progress.com>
Date: Thu, 4 Dec 2008 16:14:11 -0000

Hi

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' ?

Thanks, Sergey


> Hi,
>
> Another question.
>
> If we have say a request URI "/bar" then should
> PathSegment.getPath return "bar" or "/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 ?
>
> 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
>
> Thanks, Sergey
>
>
>
>> Hi,
>>
>> if we have say a URI ending with a forward slash '/bar/' then how many PathSegments a UriInfo.getPathSegments() should return ? I
>> think it should be 2 - can someone confirm it please ?
>>
>> Thanks, Sergey
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jsr311.dev.java.net
>> For additional commands, e-mail: users-help_at_jsr311.dev.java.net
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jsr311.dev.java.net
> For additional commands, e-mail: users-help_at_jsr311.dev.java.net
>
>