users@jsr311.java.net

Re: PathParam and slashes

From: Denis <deniak.nospam_at_gmail.com>
Date: Mon, 25 Aug 2008 15:20:41 +0200

Oh, thanks Paul.

It works great!

On Mon, Aug 25, 2008 at 3:11 PM, Paul Sandoz <Paul.Sandoz_at_sun.com> wrote:

> Hi Denis,
>
> With the 0.10 API you can do this:
>
> @Path("foo")
> public class MyClass {
> @GET
> @Path("{myparam: .+}")
> public String getPath(@PathParam("myparam") String myparam) {
> return myparam;
> }
> }
>
> You can declare a regex, as above, which overrides the default regex of
> "[^/]+?". In previous versions of the API the @Path.limited parameter
> enabled similar functionality.
>
> You can try out the regex functionality in the latest 0.10-ea-SNAPSHOT of
> the RI.
>
> Paul.
>
>
> Denis wrote:
>
>> Hi all,
>>
>> Is it possible to PathParam annotation to get params which include "/"?
>>
>> For instance, if I wrote something like that:
>>
>> @Path(/foo)
>> public class MyClass {
>> @Path("/{myparam}")
>> public void aMethod(@PathParam("myparam") String myparam) {
>> System.out.println(myparam);
>> }
>> }
>>
>> and I use that url: http://localhost/foo/a/param/with/slashes
>> I want to the String myparam set to "a/param/with/slashes"
>>
>> --
>> Denis
>>
>>
>>
> --
> | ? + ? = To question
> ----------------\
> Paul Sandoz
> x38109
> +33-4-76188109
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jsr311.dev.java.net
> For additional commands, e-mail: users-help_at_jsr311.dev.java.net
>
>