Hi Stephan, Normally, the "rootRef" property is set by the VirtualHost, each time a request is handled by one of its routes.
Are you relying on the Servlet adapter instead of the standalone mode? Maybe it isn't set properly by the ServerServlet class. Best regards, Jérôme Louvel -- Restlet ~ Founder and Lead developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com -----Message d'origine----- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Envoyé : samedi 20 septembre 2008 16:42 À : [email protected] Objet : Re: Problem with UriInfo.getPath() Hi Roman, hi Jerome, you are right. This was a bug. The org.restlet.data.Request had no rootRef given. Jerome, is this a bug in Restlet? best regards Stephan Roman Geus schrieb: > Hello all > > Calling the code > >> @Path("test") >> public class UriInfoResource { >> @GET >> @Path("example") >> @Produces("text/plain") >> public String getPlain(@Context UriInfo uriInfo) { >> StringBuilder sb = new StringBuilder(); >> sb.append("UriInfo data:\n"); >> >> List<PathSegment> segments = uriInfo.getPathSegments(); >> for (PathSegment s : segments) { >> sb.append(" path segment " + s.toString() + "\n"); >> } >> sb.append("uriInfo.getBaseUri():" + uriInfo.getBaseUri() + >> "\n"); >> sb.append("uriInfo.getPath():" + uriInfo.getPath() + "\n"); >> sb.append("uriInfo.getAbsolutePath():" + >> uriInfo.getAbsolutePath() + "\n"); return sb.toString(); >> } >> } > using the URL > >> http://localhost:8182/test/example > produces the output >> UriInfo data: >> path segment test >> path segment example >> uriInfo.getBaseUri():http://localhost:8182 >> uriInfo.getPath():http://localhost:8182/test/example >> uriInfo.getAbsolutePath():http://localhost:8182/test/example > According to the docs UriInfo.getPath() should return a relative path. > > Cheers, > Roman > > -- > Roman Geus > Paul Scherrer Institut > AIT > Scientific Computing > 5232 Villigen PSI > Switzerland > > Tel: +41 56 310 54 85 > Fax: +41 56 310 36 49 > > e-Mail: [EMAIL PROTECTED] >

