CSS文件中的JSF EL i18n [英] JSF EL i18n in CSS files
问题描述
在我的html页面中,我像这样使用Spring消息bean:
In my html pages I use the Spring message bean like so:
#{ms.my_text_label}
ms的类型为ReloadableMessageSourceBundle,将通过查找某些资源束文件来转换my_text_label.是否可以在CSS文件中使用它?
ms is of type ReloadableMessageSourceBundle and will translate my_text_label by looking in some resource bundle files. Can I make it possible to use this in my CSS files as well?
推荐答案
免责声明:我忽略了问题中的Spring WebFlow部分,并且好像JSF项目没有使用任何Spring工件.
Disclaimer: I'm ignoring the Spring WebFlow part in the question and do as if the JSF project doesn't use any Spring artifacts.
Note: this doesn't work for JS files, even not the ones loaded via <h:outputScript>
. EL is supported in CSS files for actually only one technical reason: being able to reference CSS background images via #{resource}
mapping without the need to hardcode whole library and JSF mapping.
- How to reference CSS / JS / image resource in Facelets template?
- How to reference JSF image resource as CSS background image url
这篇关于CSS文件中的JSF EL i18n的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!