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:
<?xml version="1.0" encoding="UTF-8"?>
<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">
<display-name>MyWebApp</display-name>
<servlet>
<servlet-name>MyServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>MyServlet</servlet-name>
<url-pattern>/login</url-pattern>
</servlet-mapping>
<init-param>
<param-name>trimSpaces</param-name>
<param-value>true</param-value>
</init-param>
</web-app>
I'm new at this and not sure how to go about debugging the problem. I tried putting the <init-param> inside the <servlet> 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)
I'm using Tomcat 7. Also using Spring, as you can see.
Any suggestions?