In my richfaces 4.2.0 application, all the pages use the same template:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
<title>MY APPLICATION</title>
<link href="/myapp/resources/css/stylesheet.css" rel="stylesheet" type="text/css"/>
</h:head>
<h:body class="form" >
<div id="page">
.....
</div>
</h:body>
The file stylesheet.css is used to define some global styles as well as to override some richfaces classes. My application uses automatic skinning (org.richfaces.enableControlSkinning = true) as well: in brief, stylesheet.css has been designed to override everything produced by RF which was not looking as desired.
Everything worked fine under JBoss 6 because the RF styles (ECSS) were imported before stylesheet.css and hence got overridden. Under JBoss 7 (EAP 6) happens exactly the contrary, so stylesheet.css has simply no effect.
Do you know if (and how :)) I could influence this behavior?
Thanks a lot
After making some researches on the Web I found out that a good practice should be to place the custom css (using h:outputStylesheet) at the end of the page (or better of the template). This way they are imported at the end of the head section of the generated HTML.