[ 
https://issues.apache.org/jira/browse/FELIX-5219?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15206104#comment-15206104
 ] 

Anders Engström commented on FELIX-5219:
----------------------------------------

Ah - that didn't work out of the box either. 

Requests to servlets deployed in the OSGi container is wrapped by 
{{org.apache.felix.http.base.internal.dispatch.ServletRequestWrapper#ServletRequestWrapper}}
 which overrides {{getContextPath()}} with the context path from the internal 
ServletContext (which is a 
{{org.apache.felix.http.base.internal.context.ExtServletContext}}).

So, {{requestURI() != contextPath + servletPath + pathInfo}}. 

On option is to create a HttpServletRequestWrapper in the ProxyServlet which 
fully hides the `servletPath` (also in the requestURI). I'm not sure that's a 
good solution since it could affect how, for example, relative URLs can be 
created by an end-servlet.

> Servlet Bridge does not work if not mounted as root servlet
> -----------------------------------------------------------
>
>                 Key: FELIX-5219
>                 URL: https://issues.apache.org/jira/browse/FELIX-5219
>             Project: Felix
>          Issue Type: Bug
>          Components: HTTP Service
>    Affects Versions: http.proxy-3.0.0, http.bridge-3.0.0, http.bridge-3.0.2, 
> http.bridge-3.0.4, http.bridge-3.0.6
>            Reporter: Anders Engström
>            Assignee: Carsten Ziegeler
>         Attachments: patch.txt
>
>
> As described in the email thread 
> http://www.mail-archive.com/users%40felix.apache.org/msg17074.html -- the 
> Http Servlet Proxy/Bridge does not work when binding the Proxy Servlet 
> something else than {{/*}}.
> It seems that the bug was introduced in the 3.* versions - the proxy/bridge 
> works as expected with version {{2.3.2}}.
> I've created a reference project at 
> https://github.com/metamorph/http-osgi-bridge that demonstrates the bug.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to