The style sheet does not apply on my first JSF page. I’ve got a index.jsp which forwards to my first JSF page.
<html>
<head></head>
<body>
<jsp:forward page="./start.jsf" />
</body>
</html>
On start.jsf the style sheet does not apply but if I navigate to a second page my style sheet fully applies.
The second page was my first page before and I’ve had the same behaviour. Without changes, the second page works fine as long as the page is not the first one in row.
Therefore CSS and the page itself must be correct. I think it’s a configuration issue.
Any ideas?
You should invoke the index page using an URL which invokes the
FacesServlet. It’s namely the one responsible for doing the JSF works. So you need to invoke it byindex.jsfinstead ofindex.jsp.However, better is to get rid of this hacky index page altogether and define
start.jsfas<welcome-file>inweb.xmlinstead.and supply an empty
start.jsffile in the same folder next to thestart.jspfile so that the servletcontainer will be fooled that the index page really exists (it namely by default doesn’t check on any servlet mappings for the index page).