spring配置中的坑
开始记录spring配置中的坑
spring中配置坑了好多次,现在记录一下
- 占位
messageSource中No message found under code ‘error.system’ for locale ‘zh_CN’.
- 通过分析和查看源码发现messageSource并不是在springmvc.xml中注入的bean
- 经过实验发现在springmvc.xml中注入messageSource在controller可以注入,springmvc.xml中扫描的是controller包,是不是mvc中的bean与其他的bean不能互相注入?
- 在spring.xml中注入messageSource,在controller中却可以注入messageSource,为什么?