private void renderWithinGrailsWebRequest(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response)
throws Exception {
RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
boolean attributesChanged = false;
try {
GrailsWebRequest webRequest;
if(!(requestAttributes instanceof GrailsWebRequest)) {
webRequest = createGrailsWebRequest(request, response, request.getServletContext());
attributesChanged = true;
WebUtils.storeGrailsWebRequest(webRequest);
} else {