users@jersey.java.net

[Jersey] Re: Question Mark in Path Param

From: jmandawg <jmandawg_at_hotmail.com>
Date: Fri, 11 Mar 2011 11:06:26 -0800 (PST)

> Hi,
> Query string is not part of the path, so you can't get it this way. Here
> is one example of what you can do:
> @GET @Path("/{query}")
> public String getSearch(@PathParam("query") String query, @Context
> UriInfo ui) {
> String uri = ui.getRequestUri().toString();
> int i = uri.indexOf('?');
> return query + (i != -1 ? uri.substring(i) : "");
> }
> Regards,
> Martin

Thanks for the help.  I ended up using this instead of the indexof

String query = uri.getRawQuery();
                                               

--
View this message in context: http://jersey.576304.n2.nabble.com/Question-Mark-in-Path-Param-tp6162107p6162519.html
Sent from the Jersey mailing list archive at Nabble.com.