title: JSF + Tomcat losing CSS
body: <p>I'm using JSF 2.2, Netbeans 7.4, Primefaces 3.5 Tomcat 7 and Hibernate 3.6.10.</p>
  
  <p>I'm migrating a web project that is finished and works great from normal libraries and glassfish 3.1.2 TO maven and Tomcat 7.0.41.0.</p>
  
  <p>Initially everything seems to work fine, the main page starts ok and it can be viewed perfectly with all his CSS and so on, but when I press any of the links to go to another section ALL CSS seems to get lost (even the primefaces style). </p>
  
  <p>The navigation continues working ok but no CSS is applied.</p>
  
  <p>There's an error in the Tomcat console:</p>
  
  <pre><code>Grave: El Servlet.service() para el servlet [Faces Servlet] en el contexto con ruta [/AuPair] lanzó la excepción [javax/servlet/jsp/jstl/core/Config] con causa raíz
  java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config
  </code></pre>
  
  <p>I have searched about this error over the net with no result and I don't know if it is related or not with my problem.</p>
  
  <p>I'm using templates like this:</p>
  
  <pre><code>&lt;html lang="#{sesion.idiomaActual.country}"
        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"&gt;
  
   &lt;f:view&gt;
      &lt;h:head&gt;
          &lt;link href="CSS/estilos.css" rel="stylesheet" type="text/css"/&gt;
      &lt;/h:head&gt;
      &lt;h:body&gt;           
          &lt;ui:composition template="/plantilla.xhtml"&gt;
              &lt;ui:define name="cabecera"&gt;
                  &lt;ui:include src="cabecera_vista.xhtml"/&gt;
              &lt;/ui:define&gt;
              &lt;ui:define name="contenido"&gt;
                  &lt;ui:include src="index_vista.xhtml"/&gt;
              &lt;/ui:define&gt;
              &lt;ui:define name="pie"&gt;
                  &lt;ui:include src="pie_vista.xhtml"/&gt;
              &lt;/ui:define&gt;
          &lt;/ui:composition&gt;        
      &lt;/h:body&gt;
    &lt;/f:view&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>This is the first page shown "index_vista" (firstly appears ok, but if you leave and come back it doesn't):</p>
  
  <pre><code>&lt;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:p="http://primefaces.org/ui"&gt;
  
    &lt;f:view locale="#{sesion.idiomaActual}"&gt;
      &lt;h:head&gt;
          &lt;link href="CSS/estilos.css" rel="stylesheet" type="text/css"/&gt;           
      &lt;/h:head&gt;
      &lt;h:body&gt;
          &lt;h:form&gt;            
              &lt;div id="inicio" class="area_contenido"&gt; 
                  &lt;br/&gt;                                
                  &lt;p:imageSwitch effect="fade"  styleClass="galeria_fotos"&gt;  
                      &lt;ui:repeat value="#{index_controlador.listafotos}" var="image"&gt;  
                          &lt;p:graphicImage value="/Imagenes/#{image}" /&gt;  
                      &lt;/ui:repeat&gt;  
                  &lt;/p:imageSwitch&gt; 
  
                  &lt;p:fieldset legend="#{msjs.inicio_tit1}" styleClass="panel_inicio" &gt;   
                      &lt;p:graphicImage value="/Imagenes/inicio1.jpg" styleClass="imagen_panel_inicio1"/&gt;  
                      &lt;h:outputText styleClass="texto_panel_inicio" escape="false" value="#{msjs.inicio_text1}" /&gt;                     
                  &lt;/p:fieldset&gt;  
  
                  &lt;p:fieldset legend="#{msjs.inicio_tit2}" styleClass="panel_inicio" &gt;                       
                      &lt;br/&gt;
                      &lt;h:outputText styleClass="texto_panel_inicio" escape="false" value="#{msjs.inicio_text2}" /&gt;
  
                      &lt;p:graphicImage value="/Imagenes/inicio2.jpg" styleClass="imagen_panel_inicio2" alt="Foto Apreton manos"/&gt;  
                  &lt;/p:fieldset&gt;  
  
                  &lt;p:fieldset legend="#{msjs.inicio_tit3}" styleClass="panel_inicio" &gt;   
                      &lt;p:graphicImage value="/Imagenes/inicio3.jpg" styleClass="imagen_panel_inicio3"/&gt;  
                      &lt;br/&gt;
                      &lt;h:outputText styleClass="texto_panel_inicio" escape="false" value="#{msjs.inicio_text3}"  /&gt;                     
                  &lt;/p:fieldset&gt;  
  
              &lt;/div&gt;         
          &lt;/h:form&gt;
      &lt;/h:body&gt;
    &lt;/f:view&gt; 
  &lt;/html&gt;
  </code></pre>
  
  <p>This is my POM file:</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
  &lt;groupId&gt;com.jesus&lt;/groupId&gt;
  &lt;artifactId&gt;XXX&lt;/artifactId&gt;
  &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  &lt;packaging&gt;war&lt;/packaging&gt;
  
  &lt;name&gt;XXX&lt;/name&gt;
  
  &lt;properties&gt;
      &lt;endorsed.dir&gt;${project.build.directory}/endorsed&lt;/endorsed.dir&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
  &lt;/properties&gt;
  
  &lt;dependencies&gt; 
      &lt;dependency&gt;
          &lt;groupId&gt;javassist&lt;/groupId&gt;
          &lt;artifactId&gt;javassist&lt;/artifactId&gt;
          &lt;version&gt;3.12.1.GA&lt;/version&gt;
      &lt;/dependency&gt;       
      &lt;dependency&gt;
          &lt;groupId&gt;org.glassfish&lt;/groupId&gt;
          &lt;artifactId&gt;javax.faces&lt;/artifactId&gt;
          &lt;version&gt;2.2.2&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.primefaces&lt;/groupId&gt;
          &lt;artifactId&gt;primefaces&lt;/artifactId&gt;
          &lt;version&gt;3.5&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;mysql&lt;/groupId&gt;
          &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
          &lt;version&gt;5.1.6&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;commons-fileupload&lt;/groupId&gt;
          &lt;artifactId&gt;commons-fileupload&lt;/artifactId&gt;
          &lt;version&gt;1.3&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;commons-io&lt;/groupId&gt;
          &lt;artifactId&gt;commons-io&lt;/artifactId&gt;
          &lt;version&gt;2.4&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.lowagie&lt;/groupId&gt;
          &lt;artifactId&gt;itext&lt;/artifactId&gt;
          &lt;version&gt;2.1.7&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.primefaces.themes&lt;/groupId&gt;
          &lt;artifactId&gt;redmond&lt;/artifactId&gt;
          &lt;version&gt;1.0.9&lt;/version&gt;           
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.poi&lt;/groupId&gt;
          &lt;artifactId&gt;poi&lt;/artifactId&gt;
          &lt;version&gt;3.9&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
          &lt;version&gt;3.6.10.Final&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-entitymanager&lt;/artifactId&gt;
          &lt;version&gt;3.6.10.Final&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-commons-annotations&lt;/artifactId&gt;
          &lt;version&gt;3.2.0.Final&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.transaction&lt;/groupId&gt;
          &lt;artifactId&gt;jta&lt;/artifactId&gt;
          &lt;version&gt;1.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate.javax.persistence&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-jpa-2.0-api&lt;/artifactId&gt;
          &lt;version&gt;1.0.1.Final&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax&lt;/groupId&gt;
          &lt;artifactId&gt;javaee-web-api&lt;/artifactId&gt;
          &lt;version&gt;6.0&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
  
  &lt;/dependencies&gt;
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.3.2&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;source&gt;1.6&lt;/source&gt;
                  &lt;target&gt;1.6&lt;/target&gt;
                  &lt;compilerArguments&gt;
                      &lt;endorseddirs&gt;${endorsed.dir}&lt;/endorseddirs&gt;
                  &lt;/compilerArguments&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.1.1&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;failOnMissingWebXml&gt;false&lt;/failOnMissingWebXml&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.1&lt;/version&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;phase&gt;validate&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;copy&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;configuration&gt;
                          &lt;outputDirectory&gt;${endorsed.dir}&lt;/outputDirectory&gt;
                          &lt;silent&gt;true&lt;/silent&gt;
                          &lt;artifactItems&gt;
                              &lt;artifactItem&gt;
                                  &lt;groupId&gt;javax&lt;/groupId&gt;
                                  &lt;artifactId&gt;javaee-endorsed-api&lt;/artifactId&gt;
                                  &lt;version&gt;6.0&lt;/version&gt;
                                  &lt;type&gt;jar&lt;/type&gt;
                              &lt;/artifactItem&gt;
                          &lt;/artifactItems&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  &lt;repositories&gt;
      &lt;repository&gt;
          &lt;url&gt;http://repository.primefaces.org/&lt;/url&gt;
          &lt;id&gt;PrimeFaces-maven-lib&lt;/id&gt;
          &lt;layout&gt;default&lt;/layout&gt;
          &lt;name&gt;Repository for library PrimeFaces-maven-lib&lt;/name&gt;
      &lt;/repository&gt;
  &lt;/repositories&gt;
  </code></pre>
  
  <p></p>
  
  <p>The project structure is this:</p>
  
  <p><a href="http://i61.tinypic.com/2h3sfmo.jpg" rel="nofollow">http://i61.tinypic.com/2h3sfmo.jpg</a></p>
  
  <p>I'm a beginner with Tomcat, can anyone help me with that? 
  Thanks in advance!!</p>