Note this blog is obsolete, see for the current blog In JSF 2.2 you have the ability to define a resource library contract so you can deliver a different experience on the basis of which user visits your website. This blog entry shows you how you can switch between a resource library contract on the basis of an EL expression. To show this off we define 2 CSS styles, blue and red. The blue style body {     background-color: blue; } The red style body {     background-color: red; } The landing page <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html> <html xmlns=""       xmlns:h="">     <h:head>         <title>Resource Library Contract f:view sample</title>     </h:head>     <h:body>         <h1>Resource Library Contract f:view sample</h1>         <ul>             <li><a href="#{facesContext.externalContext.requestContextPath}/faces/viewrlc.xhtml?contract=blue">Blue contract</a></li>             <li><a href="#{facesContext.externalContext.requestContextPath}/faces/viewrlc.xhtml?contract=red">Red contract</a></li>         </ul>     </h:body> </html> The using page <?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE html> <html xmlns=""       xmlns:h=""       xmlns:f="">     <f:view contracts="#{param.contract}">         <h:head>             <title>Resource Library Contract</title>             <h:outputStylesheet name="style.css"/>         </h:head>         <h:body>             <h:form>                 <p>                     The color is coming from a resource library contract.                 </p>             </h:form>         </h:body>     </f:view> </html> Note the code for this sample is available as part of the Glassfish samples (see the subversion repository at And that is it. Enjoy!