How to get the
DispatcherServlet instance from a spring
I want to perform a direct request to the the front controller servlet (avoiding the network interface) and check the response from a spring application, e.g.
Notice, we are not able to use MockMvc to check the HTML rendered by JSP because: "if you use JSPs, you can verify the JSP page to which the request was forwarded, but no HTML is rendered"(according to MockMvc vs End-to-End Tests)
So maybe if we get the
DispatcherServlet instance we could perform the request through its
doDispatch method and check the content from response.