title: How do I ensure nicely formatted HTML when I 'view source' on the browser?
body: <p>When I 'view source' using different browsers my web pages seems to always have lots of whitespace and are badly formatted. I am developing a Java web application using JSPs. </p>
  
  <p>How can I ensure that when I 'view source' I see nicely formatted HTML?</p>
  
  <p>Edit:</p>
  
  <p>When I say formatted I mean typically:</p>
  
  <p>I get this kind of thing:</p>
  
  <pre><code>&lt;div&gt;
  
  
  
  
                       &lt;p&gt;some text&lt;/p&gt;
       &lt;/div&gt;
  </code></pre>
  
  <p>when I want:</p>
  
  <pre><code>&lt;div&gt;
        &lt;p&gt;some text&lt;/p&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>In my JSPs (which use includes) everything is formatted nicely.      </p>