top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

What are different types of spring bean autowiring?

0 votes
What are different types of spring bean autowiring?
posted Nov 12, 2017 by Frank Lee
Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

1 Answer

0 votes

In Spring framework, you can wire beans automatically with auto-wiring feature. To enable it, just define the “autowire” attribute in <bean>.
Five Auto-wiring modes are supported:

1. no: Default, no auto wiring, set it manually via “ref” attribute

2. byName: Auto wiring by property name. If the name of a bean is same as the name of other bean property, auto wire it.

3. byType: Auto wiring by property data type. If data type of a bean is compatible with the data type of other bean property, auto wire it.

4. constructor: byType mode in constructor argument.

5. autodetect: If a default constructor is found, use “autowired by constructor”; Otherwise, use “autowire by type”.

answer Nov 15, 2017 by Jon Deck

Your answer


Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.
Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.