Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to specify resource library version in JSF2?

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.

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"/>

would turn into

<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"/>

And get

<link rel="stylesheet" src="javax.faces.resources/theme.css.xhtml?ln=css&v=1_2"/>

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?

like image 498
ᅙᄉᅙ Avatar asked Mar 26 '12 07:03

ᅙᄉᅙ


1 Answers

If you suppose to have the css library, you should use this directories naming scheme:

resources/css/1_1
resources/css/1_2

where resources in the jsf standard resource directory

like image 166
landal79 Avatar answered Oct 19 '22 21:10

landal79