diff --git a/jetty-ee10/jetty-ee10-servlet/src/main/java/org/eclipse/jetty/ee10/servlet/CrossContextDispatcher.java b/jetty-ee10/jetty-ee10-servlet/src/main/java/org/eclipse/jetty/ee10/servlet/CrossContextDispatcher.java index 9fcffb582a99..7907da30e8ba 100644 --- a/jetty-ee10/jetty-ee10-servlet/src/main/java/org/eclipse/jetty/ee10/servlet/CrossContextDispatcher.java +++ b/jetty-ee10/jetty-ee10-servlet/src/main/java/org/eclipse/jetty/ee10/servlet/CrossContextDispatcher.java @@ -40,7 +40,6 @@ class CrossContextDispatcher implements RequestDispatcher public static final String ORIGINAL_SERVLET_MAPPING = "org.eclipse.jetty.dispatch.originalServletMapping"; public static final String ORIGINAL_SERVLET_CONTEXT = "org.eclipse.jetty.dispatch.originalServletContext"; public static final String ORIGINAL_CONTEXT_PATH = "org.eclipse.jetty.dispatch.originalContextPath"; - public static final String ORIGINAL_PARAMS = "org.eclipse.jetty.dispatch.originalParameters"; public static final Set ATTRIBUTES = Set.of( RequestDispatcher.FORWARD_REQUEST_URI, @@ -63,8 +62,7 @@ class CrossContextDispatcher implements RequestDispatcher ORIGINAL_PATH_INFO, ORIGINAL_SERVLET_PATH, ORIGINAL_SERVLET_CONTEXT, - ORIGINAL_CONTEXT_PATH, - ORIGINAL_PARAMS + ORIGINAL_CONTEXT_PATH ); private final CrossContextServletContext _targetContext; @@ -115,7 +113,6 @@ protected Set getSyntheticNameSet() setAttribute(ORIGINAL_SERVLET_MAPPING, getServletRequest().getHttpServletMapping()); setAttribute(ORIGINAL_SERVLET_CONTEXT, getServletRequest().getServletContext()); setAttribute(ORIGINAL_CONTEXT_PATH, getServletRequest().getContextPath()); - setAttribute(ORIGINAL_PARAMS, getServletRequest().getParameterMap()); } @Override diff --git a/jetty-ee9/jetty-ee9-nested/src/main/java/org/eclipse/jetty/ee9/nested/CrossContextDispatcher.java b/jetty-ee9/jetty-ee9-nested/src/main/java/org/eclipse/jetty/ee9/nested/CrossContextDispatcher.java index 923387d67978..fb0e428ebfed 100644 --- a/jetty-ee9/jetty-ee9-nested/src/main/java/org/eclipse/jetty/ee9/nested/CrossContextDispatcher.java +++ b/jetty-ee9/jetty-ee9-nested/src/main/java/org/eclipse/jetty/ee9/nested/CrossContextDispatcher.java @@ -82,10 +82,6 @@ protected Object getSyntheticAttribute(String name) if (name == null) return null; - //Servlet Spec 9.3.1 no include attributes if a named dispatcher -/* if (_namedServlet != null && name.startsWith(Dispatcher.__INCLUDE_PREFIX)) - return null;*/ - //Special include attributes refer to the target context and path return switch (name) { @@ -134,9 +130,6 @@ public IncludeResponse(ServletCoreRequest servletCoreRequest, HttpServletRespons private class ForwardRequest extends ServletCoreRequest { - /** - * @param httpServletRequest the request to wrap - */ public ForwardRequest(ContextHandler.CoreContextRequest coreContextRequest, HttpServletRequest httpServletRequest) { super(coreContextRequest, httpServletRequest, new Attributes.Synthetic(new ServletAttributes(httpServletRequest)) @@ -241,11 +234,19 @@ public void include(ServletRequest servletRequest, ServletResponse servletRespon { HttpServletRequest httpServletRequest = (servletRequest instanceof HttpServletRequest) ? ((HttpServletRequest)servletRequest) : new ServletRequestHttpWrapper(servletRequest); HttpServletResponse httpServletResponse = (servletResponse instanceof HttpServletResponse) ? (HttpServletResponse)servletResponse : new ServletResponseHttpWrapper(servletResponse); + + Request baseRequest = Objects.requireNonNull(Request.getBaseRequest(servletRequest)); + Response baseResponse = baseRequest.getResponse(); + + ContextHandler.CoreContextRequest coreContextRequest = baseRequest.getCoreRequest(); + org.eclipse.jetty.server.Response coreResponse = coreContextRequest.getHttpChannel().getCoreResponse(); + // TODO ServletContextResponse servletContextResponse = ServletContextResponse.getServletContextResponse(servletResponse); - /* - IncludeRequest includeRequest = new IncludeRequest(httpServletRequest); - IncludeResponse includeResponse = new IncludeResponse(includeRequest, httpServletResponse); + IncludeRequest includeRequest = new IncludeRequest(coreContextRequest, httpServletRequest); + //IncludeResponse includeResponse = new IncludeResponse(includeRequest, httpServletResponse); + + /* try (Blocker.Callback callback = Blocker.callback()) { _targetContext.getTargetContext().getContextHandler().handle(includeRequest, includeResponse, callback);