I think the Sergionni problem is two-fold.
First, it is true that the so-called root relative is, like BalusC said, in fact domain relative, so, in the example is relative to http://example.com/
and not to http://example.com/context/
.
So you must specify
<link rel="stylesheet" type="text/css" href="${request.contextPath}/styles/decoration.css" />
BTW BalusC, congratulations, this is the first time I see this correctly explained! I struggled quite a lot to discover this.
But, if you want to simplify and suggest:
<link rel="stylesheet" type="text/css" href="styles/decoration.css" />
assuming that the style dir is a sibbling of your current page, then you can have the second problem:
You are then into the relative URL method and, I you came at this page by a forward and not a redirect, your browser may be fooled and not able to follow the relative path.
To solve this second issue, you must add this:
<head>
<base href="http://${request.serverName}:${request.serverPort}${request.contextPath}${request.servletPath}" />
The base element must precede any link.
By the base command, you tell your browser where you are really.
Hope it helps.
And BTW another bizarre thing in this wondeful jsf world:
to link from a page to its facelet template, the root relative link IS, this time, including the context so:
<ui:composition template="/layouts/layout.xhtml">
this links really to http://example.com/context/layouts/layout.xhtml
and not to http://example.com/layouts/layout.xhtml
like for <a>
or <link>
.
Jean-Marie Galliot