Book Image

SPRING COOKBOOK

By : Jerome Jaglale, Yilmaz
Book Image

SPRING COOKBOOK

By: Jerome Jaglale, Yilmaz

Overview of this book

This book is for you if you have some experience with Java and web development (not necessarily in Java) and want to become proficient quickly with Spring.
Table of Contents (14 chapters)
13
Index

Chapter 2. Defining Beans and Using Dependency Injection

In this chapter, we will cover the following recipes:

  • Defining a bean explicitly with @Bean
  • Defining a bean implicitly with @Component
  • Using a bean via dependency injection with @Autowired
  • Using a bean directly
  • Listing all beans
  • Using multiple configuration classes