我已经定义处理我的应用程序的资源束的弹簧豆如下:骡dataweave调用弹簧豆
<spring:bean id="renewMobileEngagementApiMessages" class="org.springframework.context.support.ResourceBundleMessageSource">
<spring:property name="basename" value="messages/renew-mobile-engagement-api-messages"></spring:property>
<spring:property name="defaultEncoding" value="UTF-8"></spring:property>
<spring:property name="fallbackToSystemLocale" value="false"></spring:property>
</spring:bean>
在我的应用程序我可以与访问它在一个变量或记录器对象例如以下MEL命令:
#[app.registry.renewMobileEngagementApiMessages.getMessage('error.clic_unavailable.description', null, sessionVars.REQUESTED_LOCALE)]
它正确返回我的属性,没有问题,直到这里。
的问题是,现在我需要访问我的属性在DW:变换消息,我无法弄清楚如何做到这一点。我试图用一个全球性的功能,但我没有得到如何访问我的“renewMobileEngagementApiMessages”对象引用,然后调用“的getMessage”的方法。
任何帮助将是伟大的。提前致谢!
你为什么不能定义这个贯通性占位https://docs.mulesoft.com/mule-user-guide/v/3.8/configuring-properties#properties-files,然后使用$ {访问属性之一.. } dataweave之外或作为'p('propName')'在dataweave中? –
因为我需要国际化。我有一个每种语言的属性文件,我使用spring资源包访问它们。 –