优先级从高到低:
The local.properties file
Extension-specific project.properties files
The global project.properties file (that is, the project.properties file in the <${HYBRIS_BIN_DIR}/platform> directory)
不推荐修改platform文件夹下面的project.properties文件,原因如下:
Commerce升级时,这个文件的内容会被覆盖。
在生产场景里,可能根本不具备这个文件所在的文件夹的修改权限。
如何在代码里访问properties
SAP Commerce properties are provided in the global ApplicationContext. With this, you can inject a specific value by using the usual Spring notation:
<bean class="Foo"> <property name="bar" value="${key_of_property}"/> </bean>
Account是一个接口,有set和get方法。
bean.xml: