0

I have the following code (based in part from this stackoverflow question:

        MockHttpServletResponse mockResponse = new MockHttpServletResponse();
        mockResponse.setContentType(CONTENT_TYPE);
        mockResponse.setCharacterEncoding(ENCODING);
        View resolvedView = viewResolver.resolveViewName(viewName);
        resolvedView.render(modelMap, request, mockResponse);
        return mockResponse.getContentAsString();

Now for some cases, when the mockResponse.getContentAsString() gets called, a StackOverFlowError happens.

I can share the JSP but at a high level why would I get a stackoverflow error when trying to get the html content from the resolved view after its been rendered?

SnG
  • 362
  • 1
  • 5
  • 18

1 Answers1

0

There is a similar situation:https://github.com/spring-projects/spring-boot/issues/13771

If it is this situation, you can change to the new springmvc version.