Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我尝试使用f:loadBundle标记将属性文件添加到 JSF 中的 xhtml 页面。我尝试以不同的方式多次这样做,但没有任何效果(prop_files/logowanie,prop_files.logowanie)。我将属性文件保存在 WebContent/prop_files 文件夹中,而 xhtml 文件位于 WebContent 中。
f:loadBundle
prop_files/logowanie
prop_files.logowanie
请帮助我如何将属性添加到页面。也许我将这些文件保存在错误的文件夹中?
af:loadBundle 标记的基本名称应该类似于类名,因为属性文件由类加载器加载,如下所示:
<f:loadBundle basename="com.examples.messages" var="msgs"/>
文件扩展名应为 .properties。
因此,将文件放在您的类路径中,例如在您的 src/java/com/examples/messages.properties