} catch (URISyntaxException e) {
throw new ServletException(e);
}
request = ForwardRequestWrapper.create(request, requestUri);
response = ForwardResponseWrapper.create(response);
RegularExpressionRequestHandler handler;
try {
if (request.getAttribute(ERROR_DISPATCHER_FORWARD_ATTRIBUTE) != null) {
handler = handlerDispatcher.getErrorHandler();
request.removeAttribute(ERROR_DISPATCHER_FORWARD_ATTRIBUTE);
} else {
handler = handlerDispatcher.getForwardHandler();
}
handler.getHandler(new URI(path)).doFilter(request, response);
} catch (URISyntaxException ex) {
throw new ServletException("Incorrect dispatcher path: " + path);
}
// now we close the output stream. For some reason this is what
// makes testImplicitImportServlet pass