wsa*_*ton 3 jsf resourcebundle properties-file composite-component
我的组件库目录树设置如下:
resources
mylib
css
mycomponent.css
properties
mycomponent.properties
mycomponent.xhtml
Run Code Online (Sandbox Code Playgroud)
我想加载 mycomponent.xhtml 中的属性文件以用于消息。这样做的正确方法是什么?是否有 f:loadbundle 类型的解决方案?
组合通过#{cc.resourceBundleMap}
. 这只需要:
所以,如果你稍微重组一下,
WebContent
|-- resources
| `-- mylib
| |-- mycomponent.css
| |-- mycomponent.properties
| `-- mycomponent.xhtml
:
Run Code Online (Sandbox Code Playgroud)
然后你应该可以访问它,如下所示:
<cc:implementation>
<h:outputStylesheet library="mylib" name="mycomponent.css" />
...
<p>Property with key "foo": #{cc.resourceBundleMap.foo}</p>
<p>Property with key "foo.bar": #{cc.resourceBundleMap['foo.bar']}</p>
</cc:implementation>
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
682 次 |
最近记录: |