@Test void testForward4() throws Exception { TestWebApplicationRequest request = new TestWebApplicationRequest(); TestWebApplicationResponse response = new TestWebApplicationResponse(); DefaultWebApplication webApp = new DefaultWebApplication(); webApp.setWebApplicationRequestMapper(new DefaultWebApplicationRequestMapper()); webApp.addServlet("Runtime", TestRuntimeExceptionServlet.class); webApp.addServletMapping("Runtime", "/Runtime"); webApp.initialize(); webApp.start(); RequestDispatcher dispatcher = webApp.getRequestDispatcher("/Runtime"); assertThrows(RuntimeException.class, () -> dispatcher.forward(request, response)); }
@Override public void forward(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException { if (servletRequest.getDispatcherType().equals(ASYNC)) { asyncForward(servletRequest, servletResponse); return; } syncForward(servletRequest, servletResponse); }
DefaultServletRequestDispatcher implements RequestDispatcher { @Override public void forward(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException { if (servletRequest.getDispatcherType().equals(ASYNC)) { asyncForward(servletRequest, servletResponse); return; } syncForward(servletRequest, servletResponse); } }
DefaultServletRequestDispatcher implements RequestDispatcher { @Override public void forward(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException { if (servletRequest.getDispatcherType().equals(ASYNC)) { asyncForward(servletRequest, servletResponse); return; } syncForward(servletRequest, servletResponse); } DefaultServletRequestDispatcher(DefaultServletInvocation servletInvocation, DefaultWebApplication webApplication); }
DefaultServletRequestDispatcher implements RequestDispatcher { @Override public void forward(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException { if (servletRequest.getDispatcherType().equals(ASYNC)) { asyncForward(servletRequest, servletResponse); return; } syncForward(servletRequest, servletResponse); } DefaultServletRequestDispatcher(DefaultServletInvocation servletInvocation, DefaultWebApplication webApplication); void request(DefaultWebApplicationRequest webappRequest, DefaultWebApplicationResponse httpResponse); @Override void forward(ServletRequest servletRequest, ServletResponse servletResponse); @Override void include(ServletRequest servletRequest, ServletResponse servletResponse); void error(String servletName, ServletRequest servletRequest, ServletResponse servletResponse, Throwable throwable); }
DefaultServletRequestDispatcher implements RequestDispatcher { @Override public void forward(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException { if (servletRequest.getDispatcherType().equals(ASYNC)) { asyncForward(servletRequest, servletResponse); return; } syncForward(servletRequest, servletResponse); } DefaultServletRequestDispatcher(DefaultServletInvocation servletInvocation, DefaultWebApplication webApplication); void request(DefaultWebApplicationRequest webappRequest, DefaultWebApplicationResponse httpResponse); @Override void forward(ServletRequest servletRequest, ServletResponse servletResponse); @Override void include(ServletRequest servletRequest, ServletResponse servletResponse); void error(String servletName, ServletRequest servletRequest, ServletResponse servletResponse, Throwable throwable);  }