我正在尝试为我的应用程序提供一个干净的方法来获取String资源包,其中包含我的JSF标签等以及我的消息和错误。
我所拥有的是“创建元素”页面,该页面在保存到验证功能时流动。
<transition on="save" to="validateElementCreate" validate="false" >
<evaluate expression="newElement.validate(messageContext)" />
</transition>
我的元素验证功能将消息添加到它提供的上下文中,但它们是硬编码的。所以我想用它将资源包传递给函数。
我的资源包名为“element_maintenance_msgs”,所以我尝试这样做:
<transition on="save" to="validateElementCreate" validate="false" >
<evaluate expression="newElement.validate(messageContext,
element_maintenance_msgs)" />
</transition>
由于在faces-config.xml中配置的资源包不起作用,因此无法正常工作。
我提供捆绑包的可移植性有哪些选择?