ruthst00 commented on code in PR #16516:
URL: https://github.com/apache/grails-core/pull/16516#discussion_r4222530476


##########
grails-web-url-mappings/src/test/groovy/org/grails/web/mapping/mvc/UrlMappingsHandlerMappingSpec.groovy:
##########
@@ -319,4 +377,44 @@ class FooController  {
     def notFound() {
         RequestContextHolder.currentRequestAttributes().response.writer << 
"Not Found"
     }
+
+    /**
+     * Simulates render(text: 'hello') or render(template: '_partial'): sets 
renderView=false,
+     * writes content, returns null. The adapter must return null so 
DispatcherServlet does not
+     * attempt view resolution. (#15819)
+     */
+    @Action
+    def renderText() {
+        def webRequest = RequestContextHolder.currentRequestAttributes()
+        webRequest.renderView = false
+        webRequest.response.writer.write('hello')
+        null
+    }
+
+    /**
+     * Simulates an action that calls render(text:) but also returns a Map — 
the bug scenario
+     * from #15819 where the adapter previously ignored renderView=false when 
result instanceof Map.
+     */
+    @Action
+    def renderTextWithMap() {
+        def webRequest = RequestContextHolder.currentRequestAttributes()

Review Comment:
   Fixed in 
https://github.com/apache/grails-core/pull/16516/changes/7675410cc74ab8b8fdbddc7dafef56cf5ca6ee83



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to