val context = ClassPathXmlApplicationContext("services.xml", "daos.xml")
// retrieve configured instance
val service = context.getBean("petStore", PetStoreService::class.java)
val service = context.getBean<PetStoreService>("petStore")
// use configured instance
var userList = service.getUsernameList()
@ -4356,7 +4358,7 @@ The following Java application runs the preceding code and configuration:
@@ -4356,7 +4358,7 @@ The following Java application runs the preceding code and configuration:
public static void main(final String[] args) throws Exception {
ApplicationContext ctx = new ClassPathXmlApplicationContext("scripting/beans.xml");
@ -4365,9 +4367,11 @@ The following Java application runs the preceding code and configuration:
@@ -4365,9 +4367,11 @@ The following Java application runs the preceding code and configuration: