Skip to content

Commit

Permalink
Merge pull request #13714 from codeconsole/trigger-sitemesh
Browse files Browse the repository at this point in the history
Fix for sitemesh.  Buffering is triggered on response.setContentType so rendering needs to be done on wrapped response.
  • Loading branch information
codeconsole authored Oct 1, 2024
2 parents 456c989 + 06c250f commit 060c935
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import org.grails.web.servlet.WrappedResponseHolder;
import org.grails.web.util.GrailsApplicationAttributes;
import org.grails.web.servlet.mvc.GrailsWebRequest;
import org.grails.web.util.WebUtils;
Expand Down Expand Up @@ -68,6 +69,8 @@ private void renderWithinGrailsWebRequest(Map<String, Object> model, HttpServlet
} else {
webRequest = (GrailsWebRequest)requestAttributes;
}
// Update response holder to latest response. Necessary for sitemesh to trigger buffering.
WrappedResponseHolder.setWrappedResponse(response);
renderTemplate(model, webRequest, request, response);
} finally {
if(attributesChanged) {
Expand Down

0 comments on commit 060c935

Please sign in to comment.