users@grizzly.java.net

Problem with Jersey

From: testn <test1_at_doramail.com>
Date: Thu, 25 Jun 2009 03:29:32 -0700 (PDT)

I ran into a problem when using Jersey with Grizzly 1.9.16

my servlet context is http://localhost:9090/abc and I have the resource like
this

@Path("Person")
@Produces("text/plain")
public class PersonResource {
        @GET
        @Produces("text/plain")
        public String getHelloWorld() {
                return "Hello World";
        }
}

It doesn't work since in ServletContainer.java

        /**
         * The HttpServletRequest.getPathInfo() and
         * HttpServletRequest.getServletPath() are in decoded form.
         *
         * On some servlet implementations the getPathInfo() removed
         * contiguous '/' characters. This is problematic if URIs
         * are embedded, for example as the last path segment.
         * We need to work around this and not use getPathInfo
         * for the decodedPath.
         */
        final String decodedBasePath = (request.getPathInfo() != null)
                ? request.getContextPath() + request.getServletPath() + "/"
                : request.getContextPath() + "/";

request.getPathInfo() returns "Person" while request.getServletPath()
returns "/"

therefore decodedBasePath = "/abc//" instead of "/abc/".

Is it expected?

-- 
View this message in context: http://www.nabble.com/Problem-with-Jersey-tp24200805p24200805.html
Sent from the Grizzly - Users mailing list archive at Nabble.com.