Details
Description
There is a special feature in Grails Sitemesh integration. If the response gets committed, the layout won't be applied.
While debugging a sample application provided by Luke Daley (related to GRAILSPLUGINS-2729 problem), I noticed that the layout didn't get applied in GrailsPageFilter because the response was committed.
try { Content content = obtainContent(contentProcessor, webAppContext, request, response, chain); if (content == null || response.isCommitted()) { return; }
I noticed that response got committed in GSPResponseWriter.close() (which calls flush(), which committed the response). (GSPResponseWriter.close() gets called
This change is just an improvement that prevents the response getting committed too early. It blocks flush() and close() while Sitemesh is active and the view is being rendered. Blocking is removed if Sitemesh gets "aborted" by setting a content type that shouldn't be decorated by Sitemesh.
Issue Links
- relates to
-
GPMAIL-27
Rendering mail on threads spawned from request threads can intermittently prevent layout being applied to request thread view
-
-
GRAILS-6049
Render template to string and write direct to response
-
-
GRAILS-3818
Make rendering operations (views, templates etc.) possible on non request threads and from services and other beans
-
Git commit for 1.3.x : https://github.com/grails/grails-core/commit/eb17322da6bd6530a40f5093380e97821d17fa37