Simplest example of dependency injection with Spring
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.settings first commit Oct 23, 2017
src/main/java/pooky/projects first commit Oct 23, 2017
target/classes first commit Oct 23, 2017
.project Update Jul 26, 2018

Spring Dependency Injection example without XML

Simplest example how can Spring Dependency example works. For all configuration are used annotations without any XML files.


  • All configuration is in pooky.projects.AppConfig
  • This class need to be annotated with @Configuration
  • Annotation @ComponentScan will scan and register beans in pooky.projects.beans
  • To run example use

Interesting reading

More demos