CSS文件中的JSF EL i18n [英] JSF EL i18n in CSS files

查看:129
本文介绍了CSS文件中的JSF EL i18n的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的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.

如果通过注意:这不适用于JS文件,甚至不适用于通过

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆