felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Felix Meschberger (JIRA)" <j...@apache.org>
Subject [jira] Updated: (FELIX-2774) HTTP Servlet RequestDispatcher 'forward' has invalid request pathInfo
Date Mon, 24 Jan 2011 10:46:43 GMT

     [ https://issues.apache.org/jira/browse/FELIX-2774?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Felix Meschberger updated FELIX-2774:
-------------------------------------

    Attachment: FELIX-2774-simple.patch

Attaching correct patch this time

> 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
>         Attachments: FELIX-2774-simple.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)
>     <servlet>
>         <servlet-name>osgi-servlet-bridge</servlet-name>
>         <servlet-class>org.apache.felix.http.proxy.ProxyServlet</servlet-class>
>         <load-on-startup>1</load-on-startup>
>     </servlet>
>     <servlet-mapping>
>         <servlet-name>osgi-servlet-bridge</servlet-name>
>         <url-pattern>/*</url-pattern>
>     </servlet-mapping>
> 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.


Mime
View raw message