开发者社区 问答 正文

为啥spring mvc中id不能 随便指定

<bean id="messageSource"
    class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
    <property name="basename" value="classpath:messages"></property>
    <property name="defaultEncoding" value="UTF-8"></property>
</bean>
`1``
我在用spring mvc实现i18n的时候,配置文件中有个如上的配置,作用是扫描i18n要用到的资源文件,其中id只能是用messageSource,用别的就报错,messagesource都不行,这是为啥子?

展开
收起
a123456678 2016-03-13 13:37:41 2108 分享 版权
1 条回答
写回答
取消 提交回答
  • 定义messageSource是spring的文档要求定义的。

    2019-07-17 19:02:28
    赞同 展开评论
问答分类:
问答标签:
问答地址: