test_class.file: webapp/impl/src/test/java/cloud/piranha/webapp/impl/DefaultServletRequestDispatcherTest.java
test_class.identifier: DefaultServletRequestDispatcherTest
test_case.body: @Test
      void testInclude2() throws Exception {
          TestWebApplicationRequest request = new TestWebApplicationRequest();
          TestWebApplicationResponse response = new TestWebApplicationResponse();
          DefaultWebApplication webApp = new DefaultWebApplication();
          webApp.addServlet("Echo2", TestEcho2Servlet.class);
          webApp.initialize();
          webApp.start();
          webApp.linkRequestAndResponse(request, response);
          RequestDispatcher dispatcher = webApp.getNamedDispatcher("Echo2");
          dispatcher.include(request, response);
          response.flushBuffer();
          String responseText = new String(response.getResponseBytes());
          webApp.unlinkRequestAndResponse(request, response);
          webApp.stop();
          assertTrue(responseText.contains("ECHO"));
      }
test_case.class_method_signature: DefaultServletRequestDispatcherTest.testInclude2()
test_case.full_signature: @Test void testInclude2()
test_case.identifier: testInclude2
test_case.invocations: addServlet initialize start linkRequestAndResponse getNamedDispatcher include flushBuffer getResponseBytes unlinkRequestAndResponse stop assertTrue contains
test_case.modifiers: @Test
test_case.parameters: ()
test_case.return: void
test_case.signature: void testInclude2()
focal_class.declarator: ASYNC_ATTRIBUTES = asList(ASYNC_CONTEXT_PATH, ASYNC_PATH_INFO, ASYNC_QUERY_STRING, ASYNC_REQUEST_URI, ASYNC_SERVLET_PATH)
focal_class.modifier: private static final
focal_class.original_string: private static final List<String> ASYNC_ATTRIBUTES = asList(ASYNC_CONTEXT_PATH, ASYNC_PATH_INFO, ASYNC_QUERY_STRING, ASYNC_REQUEST_URI, ASYNC_SERVLET_PATH);
focal_class.type: List<String>
focal_class.var_name: ASYNC_ATTRIBUTES
focal_class.declarator: servletInvocation
focal_class.modifier: private final
focal_class.original_string: private final DefaultServletInvocation servletInvocation;
focal_class.type: DefaultServletInvocation
focal_class.var_name: servletInvocation
focal_class.declarator: servletEnvironment
focal_class.modifier: private final
focal_class.original_string: private final ServletEnvironment servletEnvironment;
focal_class.type: ServletEnvironment
focal_class.var_name: servletEnvironment
focal_class.declarator: path
focal_class.modifier: private final
focal_class.original_string: private final String path;
focal_class.type: String
focal_class.var_name: path
focal_class.declarator: errorPageManager
focal_class.modifier: private final
focal_class.original_string: private final DefaultErrorPageManager errorPageManager;
focal_class.type: DefaultErrorPageManager
focal_class.var_name: errorPageManager
focal_class.declarator: invocationFinder
focal_class.modifier: private final
focal_class.original_string: private final DefaultInvocationFinder invocationFinder;
focal_class.type: DefaultInvocationFinder
focal_class.var_name: invocationFinder
focal_class.declarator: webApplication
focal_class.modifier: private final
focal_class.original_string: private final DefaultWebApplication webApplication;
focal_class.type: DefaultWebApplication
focal_class.var_name: webApplication
focal_class.file: webapp/impl/src/main/java/cloud/piranha/webapp/impl/DefaultServletRequestDispatcher.java
focal_class.identifier: DefaultServletRequestDispatcher
focal_class.interfaces: implements RequestDispatcher
focal_class.class_method_signature: DefaultServletRequestDispatcher.DefaultServletRequestDispatcher(DefaultServletInvocation servletInvocation, DefaultWebApplication webApplication)
focal_class.full_signature: public  DefaultServletRequestDispatcher(DefaultServletInvocation servletInvocation, DefaultWebApplication webApplication)
focal_class.identifier: DefaultServletRequestDispatcher
focal_class.modifiers: public
focal_class.parameters: (DefaultServletInvocation servletInvocation, DefaultWebApplication webApplication)
focal_class.signature:  DefaultServletRequestDispatcher(DefaultServletInvocation servletInvocation, DefaultWebApplication webApplication)
focal_class.class_method_signature: DefaultServletRequestDispatcher.request(DefaultWebApplicationRequest webappRequest, DefaultWebApplicationResponse httpResponse)
focal_class.full_signature: public void request(DefaultWebApplicationRequest webappRequest, DefaultWebApplicationResponse httpResponse)
focal_class.identifier: request
focal_class.modifiers: public
focal_class.parameters: (DefaultWebApplicationRequest webappRequest, DefaultWebApplicationResponse httpResponse)
focal_class.return: void
focal_class.signature: void request(DefaultWebApplicationRequest webappRequest, DefaultWebApplicationResponse httpResponse)
focal_class.class_method_signature: DefaultServletRequestDispatcher.forward(ServletRequest servletRequest, ServletResponse servletResponse)
focal_class.full_signature: @Override public void forward(ServletRequest servletRequest, ServletResponse servletResponse)
focal_class.identifier: forward
focal_class.modifiers: @Override public
focal_class.parameters: (ServletRequest servletRequest, ServletResponse servletResponse)
focal_class.return: void
focal_class.signature: void forward(ServletRequest servletRequest, ServletResponse servletResponse)
focal_class.class_method_signature: DefaultServletRequestDispatcher.include(ServletRequest servletRequest, ServletResponse servletResponse)
focal_class.full_signature: @Override public void include(ServletRequest servletRequest, ServletResponse servletResponse)
focal_class.identifier: include
focal_class.modifiers: @Override public
focal_class.parameters: (ServletRequest servletRequest, ServletResponse servletResponse)
focal_class.return: void
focal_class.signature: void include(ServletRequest servletRequest, ServletResponse servletResponse)
focal_class.class_method_signature: DefaultServletRequestDispatcher.error(String servletName, ServletRequest servletRequest, ServletResponse servletResponse, Throwable throwable)
focal_class.full_signature: public void error(String servletName, ServletRequest servletRequest, ServletResponse servletResponse, Throwable throwable)
focal_class.identifier: error
focal_class.modifiers: public
focal_class.parameters: (String servletName, ServletRequest servletRequest, ServletResponse servletResponse, Throwable throwable)
focal_class.return: void
focal_class.signature: void error(String servletName, ServletRequest servletRequest, ServletResponse servletResponse, Throwable throwable)
focal_class.class_method_signature: DefaultServletRequestDispatcher.syncForward(ServletRequest servletRequest, ServletResponse servletResponse)
focal_class.full_signature: private void syncForward(ServletRequest servletRequest, ServletResponse servletResponse)
focal_class.identifier: syncForward
focal_class.modifiers: private
focal_class.parameters: (ServletRequest servletRequest, ServletResponse servletResponse)
focal_class.return: void
focal_class.signature: void syncForward(ServletRequest servletRequest, ServletResponse servletResponse)
focal_class.class_method_signature: DefaultServletRequestDispatcher.isAsyncSupportedInChain()
focal_class.full_signature: private boolean isAsyncSupportedInChain()
focal_class.identifier: isAsyncSupportedInChain
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isAsyncSupportedInChain()
focal_class.class_method_signature: DefaultServletRequestDispatcher.setForwardAttributes(HttpServletRequest originalRequest, HttpServletRequest forwardedRequest, String... dispatcherKeys)
focal_class.full_signature: private void setForwardAttributes(HttpServletRequest originalRequest, HttpServletRequest forwardedRequest, String... dispatcherKeys)
focal_class.identifier: setForwardAttributes
focal_class.modifiers: private
focal_class.parameters: (HttpServletRequest originalRequest, HttpServletRequest forwardedRequest, String... dispatcherKeys)
focal_class.return: void
focal_class.signature: void setForwardAttributes(HttpServletRequest originalRequest, HttpServletRequest forwardedRequest, String... dispatcherKeys)
focal_class.class_method_signature: DefaultServletRequestDispatcher.setForwardAttribute(HttpServletRequest originalRequest, HttpServletRequest forwardedRequest, String dispatcherKey)
focal_class.full_signature: private void setForwardAttribute(HttpServletRequest originalRequest, HttpServletRequest forwardedRequest, String dispatcherKey)
focal_class.identifier: setForwardAttribute
focal_class.modifiers: private
focal_class.parameters: (HttpServletRequest originalRequest, HttpServletRequest forwardedRequest, String dispatcherKey)
focal_class.return: void
focal_class.signature: void setForwardAttribute(HttpServletRequest originalRequest, HttpServletRequest forwardedRequest, String dispatcherKey)
focal_class.class_method_signature: DefaultServletRequestDispatcher.updateCurrentRequest(HttpServletRequest originalRequest, HttpServletRequest forwardedRequest)
focal_class.full_signature: private CurrentRequestHolder updateCurrentRequest(HttpServletRequest originalRequest, HttpServletRequest forwardedRequest)
focal_class.identifier: updateCurrentRequest
focal_class.modifiers: private
focal_class.parameters: (HttpServletRequest originalRequest, HttpServletRequest forwardedRequest)
focal_class.return: CurrentRequestHolder
focal_class.signature: CurrentRequestHolder updateCurrentRequest(HttpServletRequest originalRequest, HttpServletRequest forwardedRequest)
focal_class.class_method_signature: DefaultServletRequestDispatcher.restoreCurrentRequest(CurrentRequestHolder currentRequestHolder, HttpServletRequest originalRequest)
focal_class.full_signature: private void restoreCurrentRequest(CurrentRequestHolder currentRequestHolder, HttpServletRequest originalRequest)
focal_class.identifier: restoreCurrentRequest
focal_class.modifiers: private
focal_class.parameters: (CurrentRequestHolder currentRequestHolder, HttpServletRequest originalRequest)
focal_class.return: void
focal_class.signature: void restoreCurrentRequest(CurrentRequestHolder currentRequestHolder, HttpServletRequest originalRequest)
focal_class.class_method_signature: DefaultServletRequestDispatcher.asyncForward(ServletRequest servletRequest, ServletResponse servletResponse)
focal_class.full_signature: private void asyncForward(ServletRequest servletRequest, ServletResponse servletResponse)
focal_class.identifier: asyncForward
focal_class.modifiers: private
focal_class.parameters: (ServletRequest servletRequest, ServletResponse servletResponse)
focal_class.return: void
focal_class.signature: void asyncForward(ServletRequest servletRequest, ServletResponse servletResponse)
focal_class.class_method_signature: DefaultServletRequestDispatcher.asyncHttpForward(AsyncHttpDispatchWrapper asyncHttpDispatchWrapper, ServletResponse servletResponse)
focal_class.full_signature: private void asyncHttpForward(AsyncHttpDispatchWrapper asyncHttpDispatchWrapper, ServletResponse servletResponse)
focal_class.identifier: asyncHttpForward
focal_class.modifiers: private
focal_class.parameters: (AsyncHttpDispatchWrapper asyncHttpDispatchWrapper, ServletResponse servletResponse)
focal_class.return: void
focal_class.signature: void asyncHttpForward(AsyncHttpDispatchWrapper asyncHttpDispatchWrapper, ServletResponse servletResponse)
focal_class.class_method_signature: DefaultServletRequestDispatcher.asyncNonHttpForward(AsyncNonHttpDispatchWrapper asyncNonHttpDispatchWrapper, ServletResponse servletResponse)
focal_class.full_signature: private void asyncNonHttpForward(AsyncNonHttpDispatchWrapper asyncNonHttpDispatchWrapper, ServletResponse servletResponse)
focal_class.identifier: asyncNonHttpForward
focal_class.modifiers: private
focal_class.parameters: (AsyncNonHttpDispatchWrapper asyncNonHttpDispatchWrapper, ServletResponse servletResponse)
focal_class.return: void
focal_class.signature: void asyncNonHttpForward(AsyncNonHttpDispatchWrapper asyncNonHttpDispatchWrapper, ServletResponse servletResponse)
focal_class.class_method_signature: DefaultServletRequestDispatcher.invokeTargetAsyncServlet(AsyncHttpDispatchWrapper asyncHttpDispatchWrapper, ServletResponse servletResponse)
focal_class.full_signature: private void invokeTargetAsyncServlet(AsyncHttpDispatchWrapper asyncHttpDispatchWrapper, ServletResponse servletResponse)
focal_class.identifier: invokeTargetAsyncServlet
focal_class.modifiers: private
focal_class.parameters: (AsyncHttpDispatchWrapper asyncHttpDispatchWrapper, ServletResponse servletResponse)
focal_class.return: void
focal_class.signature: void invokeTargetAsyncServlet(AsyncHttpDispatchWrapper asyncHttpDispatchWrapper, ServletResponse servletResponse)
focal_class.class_method_signature: DefaultServletRequestDispatcher.invokeTargetAsyncServlet(HttpServletRequest invokeServletRequest, AsyncHttpDispatchWrapper asyncHttpDispatchWrapper, ServletResponse servletResponse)
focal_class.full_signature: private void invokeTargetAsyncServlet(HttpServletRequest invokeServletRequest, AsyncHttpDispatchWrapper asyncHttpDispatchWrapper, ServletResponse servletResponse)
focal_class.identifier: invokeTargetAsyncServlet
focal_class.modifiers: private
focal_class.parameters: (HttpServletRequest invokeServletRequest, AsyncHttpDispatchWrapper asyncHttpDispatchWrapper, ServletResponse servletResponse)
focal_class.return: void
focal_class.signature: void invokeTargetAsyncServlet(HttpServletRequest invokeServletRequest, AsyncHttpDispatchWrapper asyncHttpDispatchWrapper, ServletResponse servletResponse)
focal_class.class_method_signature: DefaultServletRequestDispatcher.invokeTargetAsyncServlet(ServletRequest invokeServletRequest, HttpServletRequest previousPathRequest, AsyncHttpDispatchWrapper asyncHttpDispatchWrapper, ServletResponse servletResponse)
focal_class.full_signature: private void invokeTargetAsyncServlet(ServletRequest invokeServletRequest, HttpServletRequest previousPathRequest, AsyncHttpDispatchWrapper asyncHttpDispatchWrapper, ServletResponse servletResponse)
focal_class.identifier: invokeTargetAsyncServlet
focal_class.modifiers: private
focal_class.parameters: (ServletRequest invokeServletRequest, HttpServletRequest previousPathRequest, AsyncHttpDispatchWrapper asyncHttpDispatchWrapper, ServletResponse servletResponse)
focal_class.return: void
focal_class.signature: void invokeTargetAsyncServlet(ServletRequest invokeServletRequest, HttpServletRequest previousPathRequest, AsyncHttpDispatchWrapper asyncHttpDispatchWrapper, ServletResponse servletResponse)
focal_class.class_method_signature: DefaultServletRequestDispatcher.setAsyncAttributes(HttpServletRequest asyncStartRequest, AsyncHttpDispatchWrapper asyncHttpDispatchWrapper)
focal_class.full_signature: private void setAsyncAttributes(HttpServletRequest asyncStartRequest, AsyncHttpDispatchWrapper asyncHttpDispatchWrapper)
focal_class.identifier: setAsyncAttributes
focal_class.modifiers: private
focal_class.parameters: (HttpServletRequest asyncStartRequest, AsyncHttpDispatchWrapper asyncHttpDispatchWrapper)
focal_class.return: void
focal_class.signature: void setAsyncAttributes(HttpServletRequest asyncStartRequest, AsyncHttpDispatchWrapper asyncHttpDispatchWrapper)
focal_class.class_method_signature: DefaultServletRequestDispatcher.setAsyncAttribute(HttpServletRequest originalRequest, AsyncHttpDispatchWrapper asyncHttpDispatchWrapper, String dispatcherKey)
focal_class.full_signature: private void setAsyncAttribute(HttpServletRequest originalRequest, AsyncHttpDispatchWrapper asyncHttpDispatchWrapper, String dispatcherKey)
focal_class.identifier: setAsyncAttribute
focal_class.modifiers: private
focal_class.parameters: (HttpServletRequest originalRequest, AsyncHttpDispatchWrapper asyncHttpDispatchWrapper, String dispatcherKey)
focal_class.return: void
focal_class.signature: void setAsyncAttribute(HttpServletRequest originalRequest, AsyncHttpDispatchWrapper asyncHttpDispatchWrapper, String dispatcherKey)
focal_class.class_method_signature: DefaultServletRequestDispatcher.setRequestParameters(String queryString, AsyncHttpDispatchWrapper asyncHttpDispatchWrapper)
focal_class.full_signature: private void setRequestParameters(String queryString, AsyncHttpDispatchWrapper asyncHttpDispatchWrapper)
focal_class.identifier: setRequestParameters
focal_class.modifiers: private
focal_class.parameters: (String queryString, AsyncHttpDispatchWrapper asyncHttpDispatchWrapper)
focal_class.return: void
focal_class.signature: void setRequestParameters(String queryString, AsyncHttpDispatchWrapper asyncHttpDispatchWrapper)
focal_class.class_method_signature: DefaultServletRequestDispatcher.getServletPath(String path)
focal_class.full_signature: private String getServletPath(String path)
focal_class.identifier: getServletPath
focal_class.modifiers: private
focal_class.parameters: (String path)
focal_class.return: String
focal_class.signature: String getServletPath(String path)
focal_class.class_method_signature: DefaultServletRequestDispatcher.getQueryString(String path)
focal_class.full_signature: private String getQueryString(String path)
focal_class.identifier: getQueryString
focal_class.modifiers: private
focal_class.parameters: (String path)
focal_class.return: String
focal_class.signature: String getQueryString(String path)
focal_class.class_method_signature: DefaultServletRequestDispatcher.findHttpServletRequestInChain(ServletRequest request)
focal_class.full_signature: private HttpServletRequest findHttpServletRequestInChain(ServletRequest request)
focal_class.identifier: findHttpServletRequestInChain
focal_class.modifiers: private
focal_class.parameters: (ServletRequest request)
focal_class.return: HttpServletRequest
focal_class.signature: HttpServletRequest findHttpServletRequestInChain(ServletRequest request)
focal_class.class_method_signature: DefaultServletRequestDispatcher.rethrow(Throwable exception)
focal_class.full_signature: private void rethrow(Throwable exception)
focal_class.identifier: rethrow
focal_class.modifiers: private
focal_class.parameters: (Throwable exception)
focal_class.return: void
focal_class.signature: void rethrow(Throwable exception)
focal_method.body: @Override
      public void include(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException {
          try (DefaultWebApplicationRequest includedRequest = new DefaultWebApplicationRequest()) {
              HttpServletRequest originalRequest = (HttpServletRequest) servletRequest;
  
              includedRequest.setWebApplication(servletEnvironment.getWebApplication());
              includedRequest.setContextPath(originalRequest.getContextPath());
              includedRequest.setAttribute(INCLUDE_REQUEST_URI, originalRequest.getRequestURI());
              includedRequest.setAttribute(INCLUDE_CONTEXT_PATH, originalRequest.getContextPath());
              includedRequest.setAttribute(INCLUDE_SERVLET_PATH, originalRequest.getServletPath());
              includedRequest.setAttribute(INCLUDE_PATH_INFO, originalRequest.getPathInfo());
              includedRequest.setAttribute(INCLUDE_QUERY_STRING, originalRequest.getQueryString());
              includedRequest.setServletPath(path);
              includedRequest.setDispatcherType(INCLUDE);
              includedRequest.setPathInfo(null);
              includedRequest.setQueryString(null);
  
              CurrentRequestHolder currentRequestHolder = updateCurrentRequest(originalRequest, includedRequest);
  
              invocationFinder.addFilters(INCLUDE, servletInvocation, includedRequest.getServletPath(), "");
  
              try {
                  servletEnvironment.getWebApplication().linkRequestAndResponse(includedRequest, servletResponse);
  
                  servletInvocation.getFilterChain().doFilter(includedRequest, servletResponse);
  
                  servletEnvironment.getWebApplication().unlinkRequestAndResponse(includedRequest, servletResponse);
              } catch (Exception e) {
                  rethrow(e);
              } finally {
                  restoreCurrentRequest(currentRequestHolder, originalRequest);
              }
          }
      }
focal_method.class_method_signature: DefaultServletRequestDispatcher.include(ServletRequest servletRequest, ServletResponse servletResponse)
focal_method.full_signature: @Override public void include(ServletRequest servletRequest, ServletResponse servletResponse)
focal_method.identifier: include
focal_method.invocations: setWebApplication getWebApplication setContextPath getContextPath setAttribute getRequestURI setAttribute getContextPath setAttribute getServletPath setAttribute getPathInfo setAttribute getQueryString setServletPath setDispatcherType setPathInfo setQueryString updateCurrentRequest addFilters getServletPath linkRequestAndResponse getWebApplication doFilter getFilterChain unlinkRequestAndResponse getWebApplication rethrow restoreCurrentRequest
focal_method.modifiers: @Override public
focal_method.parameters: (ServletRequest servletRequest, ServletResponse servletResponse)
focal_method.return: void
focal_method.signature: void include(ServletRequest servletRequest, ServletResponse servletResponse)