在使用@Component、@Repository、@Service、@Controller等注解创建bean时,如果不指定bean名称,bean名称的默认规则是类名的首字母小写,如SysConfig - sysConfig,Tools - tools。

如果类名前两个或以上个字母都是大写,那么bean名称与类名一样,如RBACUserLog - RBACUserLog,RBACUser - RBACUser,RBACRole - RBACRole。

猜想:其他的非驼峰式的类名,bean名称 应该也是直接使用类名。

 

注入时需要注意一下。

相关文章:

  • 2021-11-15
  • 2021-09-30
  • 2022-12-23
  • 2021-08-11
  • 2021-10-02
  • 2021-10-31
  • 2022-02-23
  • 2022-12-23
猜你喜欢
  • 2021-05-09
  • 2022-02-13
  • 2021-09-23
  • 2021-09-18
  • 2021-09-22
相关资源
相似解决方案