title: Can I remove unnecessary newlines/whitespace in my Spring Framework webapp response data?
body: <p>In the response my server gives to the client, I am noticing quite a bit of whitespace and newlines. The response body seems to be sending a newline for every line of parsed JSP. I am just curious if this is a problem someone has already written a bean for? Is this something I even need to worry about?</p>
  
  <p><strong>Example JSP:</strong></p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
  &lt;%@page import="java.util.Date"%&gt;
  &lt;%@page import="java.util.GregorianCalendar"%&gt;
  &lt;%@page import="java.util.Properties"%&gt;
  &lt;%@page import="java.util.Map"%&gt;
  &lt;%@page import="java.util.HashMap"%&gt;
  &lt;%@page import="java.io.IOException"%&gt;
  &lt;head&gt;
    &lt;title&gt;My Page!&lt;/title&gt;
    &lt;% String message = "Hello World!"; %&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;div&gt;&lt;%=message%&gt;&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>Example HTML Response:</strong></p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
  
  
  &lt;!-- THESE ARE BLANK NEWLINES ... --&gt;
  
  
  
  &lt;head&gt;
    &lt;title&gt;My Page!&lt;/title&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
    &lt;div&gt;Hello World!&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>