Ao selecionar o tema ele aplica normalmente, mas ao tentar trocar de pagina dispara a seguinte exceção
Type Exception Report
Message Error loading css, cannot find "theme.css" resource of "primefaces-" library
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
Exception
javax.servlet.ServletException: Error loading css, cannot find "theme.css" resource of "primefaces-" library
javax.faces.webapp.FacesServlet.service(FacesServlet.java:671)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
Root Cause
javax.faces.FacesException: Error loading css, cannot find "theme.css" resource of "primefaces-" library
org.primefaces.renderkit.HeadRenderer.encodeCSS(HeadRenderer.java:149)
org.primefaces.renderkit.HeadRenderer.encodeBegin(HeadRenderer.java:81)
javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:865)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:1854)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:458)
com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:134)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:659)
Meu web-xml
<context-param>
<param-name>primefaces.THEME</param-name>
<param-value>#{temaBean.tema}</param-value>
</context-param>
Meu bean
@ManagedBean
@SessionScoped
public class TemaBean {
private String tema = "bootstrap";
public String getTema() {
return tema;
}
public void setTema(String tema) {
this.tema = tema;
}
public String[] getTemas() {
return new String[] { "afterdark", "afternoon", "afterwork", "aristo",
"black-tie", "blitzer", "bluesky", "bootstrap", "casablanca",
"cupertino", "cruze", "dark-hive", "delta", "dot-luv",
"eggplant", "excite-bike", "flick", "glass-x", "home",
"hot-sneaks", "humanity", "le-frog", "midnight", "mint-choc",
"overcast", "pepper-grinder", "redmond", "rocket", "sam",
"smoothness", "south-street", "start", "sunny", "swanky-purse",
"trontastic", "ui-darkness", "ui-lightness", "vader" };
}
}
Meu template
<p:themeSwitcher id="basic" style="width:165px" value="#{temaBean.tema}">
<f:selectItem itemLabel="Aristo" itemValue="aristo" />
<f:selectItem itemLabel="Vader" itemValue="vader" />
<f:selectItem itemLabel="Bootstrap" itemValue="bootstrap" />
<f:selectItem itemLabel="Omega" itemValue="omega" />
<f:ajax/>
</p:themeSwitcher>
Adicionei o jar de all-themes-1.0.10 na pasta lib dentro de web-inf. Mas sempre quando navego de pagina dispara essa exceção