Tenho uma aplicação com facelets, seam, richfaces na seguinte estrutura:
|web
-|web-inf
-|img
-|layout
—template.xhtml
-|paginas
—dicionario.xhtml
-|stylesheet
—theme.css
-login.xhtml
Quando executo a aplicação, a página de login.xhtml é carregada, com o CSS bonitinho. Ao logar sou redirecionado para paginas/dicionario.xhml, porém o CSS não é carregado. Se eu tirar a página dicionario.xhtml da folder paginas e colocar na raiz, o CSS carrega normalmente.
página dicionario.xhtml
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
template="./../layout/template.xhtml">
<ui:define name="body">
body
</ui:define>
</ui:composition>
template.xhtml
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:s="http://jboss.com/products/seam/taglib">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Dicionario</title>
<link href="stylesheet/theme.css" rel="stylesheet" type="text/css" />
</head>
<body>
<ui:include src="menu.xhtml">
<ui:param name="projectName" value="Dicionário"/>
</ui:include>
<div class="body">
<ui:insert name="body"/>
</div>
<div class="footer">
Powered by me.
</div>
</body>
</html>
OBS: criei o template e os templates clients usando o plugin do netbeans.
Alguém sabe porque a página não carrega com CSS quando está em um subdiretório?