You are previewing Spring in Action, Third Edition.

Spring in Action, Third Edition

Cover of Spring in Action, Third Edition by Craig Walls Published by Manning Publications
O'Reilly logo

Chapter 3. Minimizing XML configuration in Spring


This chapter covers
  • Automatic bean wiring
  • Automatic bean discovery
  • Annotation-oriented bean wiring
  • Java-based Spring configuration


So far, we’ve seen how to declare beans using the <bean> element and inject <bean> with values using either the <constructor-arg> or <property> element. That’s all well and good for a small application where you only have a handful of beans. But as your application grows, so will the amount of XML configuration you’ll write.

Fortunately, Spring offers a few tricks to help cut down on the amount of XML configuration required:

  • Autowiring helps reduce or even eliminate the need for <property> and <constructor-arg> elements by letting Spring automatically figure ...

The best content for your career. Discover unlimited learning on demand for around $1/day.