Learn Java for Web Development

(Tina Meador) #1

208 CHAPTER 5: Building Java Web Applications with Spring Web MVC


the control has been removed from ClassA and kept elsewhere (that is, in an XML configuration file,
illustrated in Listing 5-3) and thus “inverted” by dependency injection (DI) because the dependency
is delegated to an external system, in other words, the configuration metadata. Listing 5-3 illustrates
a typical Spring configuration metadata file.


Listing 5-3. Configuration Metadata



  1. <?xml version="1.0" encoding="UTF-8"?>

  2. <beans xmlns="http://www.springframework.org/schema/beans"

  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

  4. xsi:schemaLocation="http://www.springframework.org/schema/beans

  5. http://www.springframework.org/schema/beans/spring-beans-3.2.xsd">











Documentation