Polishing

This commit is contained in:
Juergen Hoeller
2020-11-27 21:58:55 +01:00
parent 81c1b60f19
commit 7c33c70742
3 changed files with 23 additions and 19 deletions

View File

@@ -67,7 +67,7 @@ The following example defines a class that has a dependency on the `Messenger` i
The following example implements the `Messenger` interface in Groovy:
[source,java,indent=0]
[source,groovy,indent=0]
[subs="verbatim,quotes"]
----
// from the file 'Messenger.groovy'
@@ -282,7 +282,7 @@ surrounded by quotation marks. The following listing shows the changes that you
(the developer) should make to the `Messenger.groovy` source file when the
execution of the program is paused:
[source,java,indent=0]
[source,groovy,indent=0]
[subs="verbatim,quotes"]
----
package org.springframework.scripting
@@ -371,7 +371,7 @@ constructors and properties 100% clear, the following mixture of code and config
does not work:
.An approach that cannot work
[source,java,indent=0]
[source,groovy,indent=0]
[subs="verbatim,quotes"]
----
// from the file 'Messenger.groovy'
@@ -480,9 +480,9 @@ Finally, the following small application exercises the preceding configuration:
public class Main {
public static void Main(String[] args) {
public static void main(String[] args) {
ApplicationContext ctx = new ClassPathXmlApplicationContext("beans.xml");
Calculator calc = (Calculator) ctx.getBean("calculator");
Calculator calc = ctx.getBean("calculator", Calculator.class);
System.out.println(calc.add(2, 8));
}
}
@@ -697,7 +697,7 @@ beans, you have to enable the "`refreshable beans`" functionality. See
The following example shows an `org.springframework.web.servlet.mvc.Controller` implemented
by using the Groovy dynamic language:
[source,java,indent=0]
[source,groovy,indent=0]
[subs="verbatim,quotes"]
----
// from the file '/WEB-INF/groovy/FortuneController.groovy'