title: JSP trimSpaces directive not working!
body: <p>I'm trying to trim JSP whitespace using the trimSpaces directive in my web.xml, but it's not working. Here's my web.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
              xmlns="http://java.sun.com/xml/ns/javaee" 
              xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_4.xsd" 
              xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" 
              id="WebApp_ID" 
              version="2.4"&gt;
  
    &lt;display-name&gt;MyWebApp&lt;/display-name&gt;
  
    &lt;servlet&gt;
      &lt;servlet-name&gt;MyServlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
    &lt;/servlet&gt;
  
    &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;MyServlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/login&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
  
    &lt;init-param&gt;
      &lt;param-name&gt;trimSpaces&lt;/param-name&gt;
      &lt;param-value&gt;true&lt;/param-value&gt;
    &lt;/init-param&gt;
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p>I'm new at this and not sure how to go about debugging the problem. I tried putting the &lt;init-param&gt; inside the &lt;servlet&gt; tags, but that didn't work. Maybe there's something wrong with the xml schema? Or maybe my JSP version isn't correct? (I only installed Tomcat a few months ago, so it's pretty recent) </p>
  
  <p>I'm using Tomcat 7. Also using Spring, as you can see. </p>
  
  <p>Any suggestions?</p>