Skip to content

Commit dbbb41e

Browse files
author
DESKTOP-BL7US23\architbiet
committed
default Component name for bean id
1 parent 6a0901f commit dbbb41e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/com/luv2code/springdemo/AnnotationDemoApp.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public static void main(String[] args) {
1010
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
1111

1212
// Retrieve the bean from Spring container
13-
Coach coach = context.getBean("thatSillyCoach", Coach.class);
13+
Coach coach = context.getBean("tennisCoach", Coach.class);
1414

1515
// Call methods on the bean
1616
System.out.println(coach.getDailyWorkout());

src/com/luv2code/springdemo/TennisCoach.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @Component - To find Spring within the component scan that which classes are beans
77
* thatSillyCoach - bean id
88
*/
9-
@Component("thatSillyCoach")
9+
@Component
1010
public class TennisCoach implements Coach {
1111

1212
@Override

0 commit comments

Comments
 (0)