users@jersey.java.net

Re: [Jersey] Including Folder path as a URI variable

From: Pavel Bucek <Pavel.Bucek_at_Sun.COM>
Date: Thu, 11 Mar 2010 16:29:29 +0100

Hello,

you need to declare your method as

@GET
@Path("/{folderpath:.*}")
public void getFolderbyPath(@PathParam("folderpath") String folderPath) {
...
}

and folderpath should be available through "folderPath" parameter.

Notice {folderpath:.*}. Jersey by default consider "/" as end of
parameter so you have to explicitly say you are accepting everything
after first "/".

Regards,
Pavel


emile wrote:
> Hi,
>
> We are using a method as follows -
>
> @GET
> @Path("/{folderpath}")
> public void getFolderbyPath
> {
>
> //..
>
> }
>
> I'm not sure how we can incorporate a folder path into the variable; for
> e.g. for a value like '/Temp/bin', i get a requested resource not available.
>
> Thanks in Advance,
> emile
>