如果我的占位符键以“数据库”开头,我会收到循环引用错误
此配置出现错误。
<bean id="paymentTransactionLogMessageDecoratorDao"
class="com.gsicommerce.payment.dao.PaymentTransactionLogMessageDecoratorDao">
<constructor-arg ref="paymentTransactionLogMessageDao"/>
<constructor-arg value="${database.payments.logging.enabled}"/>
</bean>
错误:循环占位符参考 属性定义中的“ database.payments.logging.enabled”
当我们这样更改键名时,
<bean id="paymentTransactionLogMessageDecoratorDao"
class="com.gsicommerce.payment.dao.PaymentTransactionLogMessageDecoratorDao">
<constructor-arg ref="paymentTransactionLogMessageDao"/>
<constructor-arg value="${payments.database.logging.enabled}"/>
</bean>
这有效。我们有任何备用关键字(“数据库”)吗?
如您所见,它的构造函数注入和属性名称完全不同。
public paymentTransactionLogMessageDecoratorDao(PaymentTransactionLogPersistenceServicetransactionLogMessageDao,
boolean databaseLoggingEnabled) {
this.transactionLogPersistenceService = transactionLogMessageDao;
this.databaseLoggingEnabled = databaseLoggingEnabled;
}