Skip to content

Commit aeed3c9

Browse files
committed
Move the "Groovy Bean Definition DSL" section
This commit moves the "Groovy Bean Definition DSL" section to the Groovy page Closes gh-35721
1 parent 4880ed5 commit aeed3c9

File tree

2 files changed

+33
-36
lines changed

2 files changed

+33
-36
lines changed

framework-docs/modules/ROOT/pages/core/beans/basics.adoc

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -239,40 +239,6 @@ The namespace itself provides the import directive feature. Further
239239
configuration features beyond plain bean definitions are available in a selection
240240
of XML namespaces provided by Spring -- for example, the `context` and `util` namespaces.
241241

242-
[[beans-factory-groovy]]
243-
=== The Groovy Bean Definition DSL
244-
245-
As a further example for externalized configuration metadata, bean definitions can also
246-
be expressed in Spring's Groovy Bean Definition DSL, as known from the Grails framework.
247-
Typically, such configuration live in a ".groovy" file with the structure shown in the
248-
following example:
249-
250-
[source,groovy,indent=0,subs="verbatim,quotes"]
251-
----
252-
beans {
253-
dataSource(BasicDataSource) {
254-
driverClassName = "org.hsqldb.jdbcDriver"
255-
url = "jdbc:hsqldb:mem:grailsDB"
256-
username = "sa"
257-
password = ""
258-
settings = [mynew:"setting"]
259-
}
260-
sessionFactory(SessionFactory) {
261-
dataSource = dataSource
262-
}
263-
myService(MyService) {
264-
nestedBean = { AnotherBean bean ->
265-
dataSource = dataSource
266-
}
267-
}
268-
}
269-
----
270-
271-
This configuration style is largely equivalent to XML bean definitions and even
272-
supports Spring's XML configuration namespaces. It also allows for importing XML
273-
bean definition files through an `importBeans` directive.
274-
275-
276242
[[beans-factory-client]]
277243
== Using the Container
278244

framework-docs/modules/ROOT/pages/languages/groovy.adoc

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,37 @@ Groovy is a powerful, optionally typed, and dynamic language, with static-typing
66
compilation capabilities. It offers a concise syntax and integrates smoothly with any
77
existing Java application.
88

9+
[[beans-factory-groovy]]
10+
== The Groovy Bean Definition DSL
11+
912
The Spring Framework provides a dedicated `ApplicationContext` that supports a Groovy-based
10-
Bean Definition DSL. For more details, see
11-
xref:core/beans/basics.adoc#beans-factory-groovy[The Groovy Bean Definition DSL].
13+
Bean Definition DSL, as known from the Grails framework.
14+
15+
Typically, such configuration live in a ".groovy" file with the structure shown in the
16+
following example:
17+
18+
[source,groovy,indent=0,subs="verbatim,quotes"]
19+
----
20+
beans {
21+
dataSource(BasicDataSource) {
22+
driverClassName = "org.hsqldb.jdbcDriver"
23+
url = "jdbc:hsqldb:mem:grailsDB"
24+
username = "sa"
25+
password = ""
26+
settings = [mynew:"setting"]
27+
}
28+
sessionFactory(SessionFactory) {
29+
dataSource = dataSource
30+
}
31+
myService(MyService) {
32+
nestedBean = { AnotherBean bean ->
33+
dataSource = dataSource
34+
}
35+
}
36+
}
37+
----
38+
39+
This configuration style is largely equivalent to XML bean definitions and even
40+
supports Spring's XML configuration namespaces. It also allows for importing XML
41+
bean definition files through an `importBeans` directive.
42+

0 commit comments

Comments
 (0)