使用包含空格的Spring bean ID时是否有任何注意事项?

时间:2015-03-18 15:15:57

标签: java spring naming-conventions spring-bean

大多数Spring bean ID示例都使用Java样式的变量名,例如someBean。但是,这种风格没有强制执行;实际上,允许使用空格和一些其他特殊字符(从Spring 3.1及更高版本开始)。可以使用更多详细的bean ID进行参数,例如:

<bean id="Some Bean" />

到目前为止,我只遇到过使用像这样的bean ID的问题(参见How can I declare a Spring `depends-on` attribute with a bean ID that contains spaces?)。在选择带空格的bean名称时是否还有其他重要的后果或限制?

0 个答案:

没有答案