如何在JSF2中指定资源库版本? [英] How to specify resource library version in JSF2?
问题描述
说我在webroot中有一个resources/
文件夹.其中有一个css/
文件夹,其中有一个theme.css
文件.
Say I have a resources/
folder in the webroot. In it, I have a css/
folder and in it there is a theme.css
file.
但是我想设置一个Expires:
标头.因此,我想对资源库使用一个版本,例如
But I want to set an Expires:
header. Therefore I want to use a version for resource libraries, say
<h:outputStylesheet library="css" name="theme.css"/>
会变成
<link rel="stylesheet" src="javax.faces.resources/theme.css.xhtml?ln=css"/>
但是我想指定类似的内容
But I want to specify something like
<h:outputStylesheet library="css" name="theme.css" version="1.2"/>
并获得
<link rel="stylesheet" src="javax.faces.resources/theme.css.xhtml?ln=css&v=1_2"/>
或类似.我已经了解到JSF2支持资源版本控制,但是如何如何指定要加载的版本以及在何处放置文件?
or similar. I have read that JSF2 has support for resource versioning, but how do I specify which version to load, and where do I put the files?
推荐答案
如果您想拥有css
库,则应使用以下目录命名方案:
If you suppose to have the css
library, you should use this directories naming scheme:
resources/css/1_1
resources/css/1_2
jsf标准资源目录中的resources
其中
where resources
in the jsf standard resource directory
这篇关于如何在JSF2中指定资源库版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!