Skip to content

Commit 5a2f675

Browse files
committed
Merge pull request #9959 from grails/grails-views-issue-27
Added/exposed controllerNamespace on the RenderContext
2 parents 91b08f7 + 0036fbf commit 5a2f675

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

grails-plugin-rest/src/main/groovy/grails/rest/render/RenderContext.groovy

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ public interface RenderContext {
107107
*/
108108
String getControllerName()
109109

110+
/**
111+
* @return The current controller name
112+
*/
113+
String getControllerNamespace()
114+
110115
/**
111116
* Returns true if the getWriter() method was called
112117
*/

grails-plugin-rest/src/main/groovy/org/grails/plugins/web/rest/render/ServletRenderContext.groovy

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,11 @@ class ServletRenderContext extends AbstractRenderContext {
160160
webRequest.controllerName
161161
}
162162

163+
@Override
164+
String getControllerNamespace() {
165+
return webRequest.controllerNamespace
166+
}
167+
163168
@Override
164169
boolean wasWrittenTo() {
165170
return writerObtained

0 commit comments

Comments
 (0)