Spring BeanName generation rules

1. XML way

<bean class="com.fishblog.service.UserService"></bean>

beanName: com.fishblog.service.UserService#0

 

2. Notes

@Component
public class UserService() { ... } 

beanName:  userService

PVServiceImpl(类名) ===> beanName:PVServiceImpl

Special: When the first letter of the class name and the second letter is capitalized when the class will use the original name as beanName

 

Guess you like

Origin www.cnblogs.com/myf008/p/11468961.html