Return-Path: Delivered-To: apmail-felix-dev-archive@www.apache.org Received: (qmail 73140 invoked from network); 12 Jan 2011 04:46:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 12 Jan 2011 04:46:09 -0000 Received: (qmail 15924 invoked by uid 500); 12 Jan 2011 04:46:09 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 15531 invoked by uid 500); 12 Jan 2011 04:46:07 -0000 Mailing-List: contact dev-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list dev@felix.apache.org Received: (qmail 15522 invoked by uid 99); 12 Jan 2011 04:46:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Jan 2011 04:46:06 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Jan 2011 04:46:05 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id p0C4jjmS021626 for ; Wed, 12 Jan 2011 04:45:45 GMT Message-ID: <11376440.305401294807545585.JavaMail.jira@thor> Date: Tue, 11 Jan 2011 23:45:45 -0500 (EST) From: "Felix Meschberger (JIRA)" To: dev@felix.apache.org Subject: [jira] Updated: (FELIX-2774) HTTP Servlet RequestDispatcher 'forward' has invalid request pathInfo In-Reply-To: <20562257.295091294780367766.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FELIX-2774?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Felix Meschberger updated FELIX-2774: ------------------------------------- Attachment: FELIX-1962-listeners.patch Simple patch against the HTTP Base module: - Removes the Request Wrapper overwriting getRequestURI method from the game - Adds a ServletHandler.handleInclude method which calls the Servlet's service method without the ServletHandlerRequestWrapper (on the grounds that the path related getter methods must return the same values) - Adds a resetBuffer() call to the forward method What's still missing is the management of the request attributes mandated by the Servlet API specification Shall we go this route ? Any takers to hack on the request attribute provisioning ? > HTTP Servlet RequestDispatcher 'forward' has invalid request pathInfo > --------------------------------------------------------------------- > > Key: FELIX-2774 > URL: https://issues.apache.org/jira/browse/FELIX-2774 > Project: Felix > Issue Type: Bug > Components: HTTP Service > Affects Versions: http-2.0.4 > Reporter: David Hay > Assignee: Felix Meschberger > Attachments: FELIX-1962-listeners.patch > > > I'm trying to have one servlet forward to another servlet. However, the forwarding doesn't seem to work. > I've set up the proxy servlet in my web.xml as follows (and this is the only servlet...no filters defined) > > osgi-servlet-bridge > org.apache.felix.http.proxy.ProxyServlet > 1 > > > osgi-servlet-bridge > /* > > I then have two bundles, each registers a servlet under a different path (e.g. bundle A registers under alias '/a' and bundle B registers under alias '/b') using the whiteboard pattern. The implementation of servlet A ends up doing this: > RequestDispatcher rd = request.getRequestDispatcher("/b/some/path"); > rd.forward(request, response); > This finds the ServletHandler for servlet B just fine, but gets hung up in the 'handle' method. I think this is due to the implementation of the internal RequestWrapper class in the ServletPipeline class. This implementation overrides the getRequestURI method with the passed in value. However, ServletHandler.handle passed the result of HttpServletRequest.getPathInfo() to the 'matches' method as a final check to make sure that the servlet should be invoked. Since the RequestWrapper class does not override getPathInfo, it returns the value from the original request....which is '/a' in my example. > -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.