I was having problemas using primefaces theme and JSF 2.0 resource management, as it seems that the images were not being found and even the css, even setting the link to the css like:
Code: Select all
<link type="text/css" rel="stylesheet" href="${request.contextPath}/app/resources/%THEME_FOLDER%/skin.css">
So, to not stress myself much about it, I changed the theme CSS to work with JSF 2 h:outputStyle. What I needed to do is only change the link to the images to use #{resource[]}. To do that, using eclipse, I used the the find/replace tool (CTRL+F) checking the regular expression ON.
In the find input I entered
And in the replace folder
Code: Select all
\"\#\{resource\[\'%THEME_FOLDER%\/images:$2'\]\}\"
Now, to add the theme I can use the h:outputStyleSheet like this:
Code: Select all
<h:outputStyleSheet library="%THEME_FOLDER%" name="skin.css" />
And it works like a charm
Just remenber to change %THEME_FOLDER% to where your theme is placed under the 'resources' folder. Example: "resources/css/themes/aristo", then %THEME_FOLDER% = "css/themes/aristo".
Hope it helps someone
If there's an easier way to do this, please reply.