You are on page 1of 7

@Components - Default

Bean ID
We already learned …

1. Specify the bean id in the component annotation

www.luv2code.com
Spring also supports Default Bean IDs

• Default bean id: the class name, make first letter lower-case

Class Name Default Bean Id

TennisCoach tennisCoach

www.luv2code.com
Code example

www.luv2code.com
Code example

Class Name Default Bean Id

TennisCoach tennisCoach

www.luv2code.com
Code example

www.luv2code.com
Code example

Class Name Default Bean Id

HappyFortuneService happyFortuneService

www.luv2code.com

You might also like