You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: grails-doc/src/en/guide/upgrading/upgrading60x.adoc
+76-1Lines changed: 76 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1162,4 +1162,79 @@ grails {
1162
1162
}
1163
1163
----
1164
1164
1165
-
This allows you to use classes from these packages without explicit imports throughout your Groovy code. The `starImports` configuration works independently and will be combined with any imports from `importGrailsCommonAnnotations` or `importJavaTime` flags if those are also enabled.
1165
+
This allows you to use classes from these packages without explicit imports throughout your Groovy code. The `starImports` configuration works independently and will be combined with any imports from `importGrailsCommonAnnotations` or `importJavaTime` flags if those are also enabled.
1166
+
1167
+
===== 12.30 Scaffolding Namespace View Defaults
1168
+
1169
+
Grails 7.1 introduces an opt-in feature for scaffolding that allows namespace-specific scaffolded templates to take priority over non-namespaced view fallbacks.
1170
+
1171
+
====== Background
1172
+
1173
+
Previously, when a namespace controller requested a view, the scaffolding plugin would only generate a scaffolded view if no view existed at all. This meant that if you had:
1174
+
1175
+
* A namespace controller (e.g., `namespace = 'admin'`)
1176
+
* A non-namespaced view in `grails-app/views/event/index.gsp`
1177
+
* A namespace-specific scaffolded template in `src/main/templates/scaffolding/admin/index.gsp`
1178
+
1179
+
The non-namespaced view would always be used, and the namespace-specific scaffolded template would be ignored.
1180
+
1181
+
====== New Behavior
1182
+
1183
+
With the new `enableNamespaceViewDefaults` configuration, namespace-specific scaffolded templates can now override non-namespaced view fallbacks. This provides better support for namespace-specific customization of scaffolded views.
1184
+
1185
+
====== Configuration
1186
+
1187
+
To enable this feature, add the following to your `application.yml`:
1188
+
1189
+
[source,yml]
1190
+
.application.yml
1191
+
----
1192
+
grails:
1193
+
scaffolding:
1194
+
enableNamespaceViewDefaults: true
1195
+
----
1196
+
1197
+
====== View Resolution Priority
1198
+
1199
+
When `enableNamespaceViewDefaults` is enabled, the view resolution priority for namespace controllers is:
The admin controller will use the admin-specific template even if a non-namespaced view exists.
1237
+
1238
+
====== Backward Compatibility
1239
+
1240
+
This feature is **disabled by default** (`false`), ensuring complete backward compatibility. Existing applications will continue to work without any changes. Enable the feature only when you need namespace-specific scaffolded template support.
0 commit comments