users@jersey.java.net

[Jersey] Re: Catch all requests under a specific path

From: Erik Holstad <erikholstad_at_gmail.com>
Date: Tue, 25 Mar 2014 17:41:46 -0700

Thanks!


On Mon, Mar 24, 2014 at 8:58 PM, Simon Roberts <
simon_at_dancingcloudphotography.com> wrote:

> I'm not totally sure I know what you want, but this does what I think
> you're asking for:
>
> @Path("someting/{seg: .*}")
>
> It will match _anything_ starting with something, no matter how many more
> elements come below it (because the wildcard matches / too)
>
> You would inject this into your method arguments:
>
> @Context UriInfo uriInfo,
>
> and you can extract the individual segments like this:
>
> List<PathSegment> lps = uriInfo.getPathSegments();
>
> HTH,
> Simon
>
>
>
>> Subject: [Jersey] Re: Catch all requests under a specific path
>>
>> I'm planning to use this for testing purposes, so would be nice to
>> capture all requests instead of having to add a new endpoint every time I
>> add a new one to that actual code.
>>
>>
> --
> Simon Roberts
> Certified Professional Photographer
> http://dancingcloudphotography.com
> (303) 249 3613
>



-- 
Regards Erik