Bug 544394 - [http whiteboard] INCLUDE dispatching in bridge mode mishandles reconstruction of requestURI

Signed-off-by: Raymond Auge <raymond.auge@liferay.com>
diff --git a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ProxyServlet.java b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ProxyServlet.java
index d56f082..df672ad 100644
--- a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ProxyServlet.java
+++ b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ProxyServlet.java
@@ -77,7 +77,13 @@
 			return null;
 		}
 		String requestUri = HttpServletRequestWrapperImpl.getDispatchRequestURI(request);
-		return requestUri.substring(request.getContextPath().length() + request.getServletPath().length());
+		String contextPath = request.getContextPath();
+		String servletPath = request.getServletPath();
+		if (request.getDispatcherType() == DispatcherType.INCLUDE) {
+			contextPath = (String)request.getAttribute(RequestDispatcher.INCLUDE_CONTEXT_PATH);
+			servletPath = (String)request.getAttribute(RequestDispatcher.INCLUDE_SERVLET_PATH);
+		}
+		return requestUri.substring(contextPath.length() + servletPath.length());
 	}
 
 	/**