title: JSP tricks to make templating easier?
body: <p>At work I've been tasked with turning a bunch of <code>HTML</code> files into a simple <code>JSP</code> project. It's really all static, no serverside logic to program. I should mention I'm completely new to Java. JSP files seem to make it easy to work with common includes and variables, much like <code>PHP</code>, but I'd like to know a simple way to get something like template inheritance (<code>Django</code> style) or at least be able to have a base.jsp file containing the header and the footer, so I can insert content later.</p>
  
  <p><em>Ben Lings</em> seems to offer some hope in his answer here:
  <a href="https://stackoverflow.com/questions/490390/jsp-template-inheritance">JSP template inheritance</a>
  Can someone explain how to achieve this?</p>
  
  <p>Given that I don't have much time I think dynamic routing is a little much, so I'm happy to just to have URLs map directly onto <code>.jsp</code> files, but I'm open to suggestion.</p>
  
  <p><em>Thanks.</em></p>
  
  <p><strong>edit:</strong> I don't want to use any external libraries, because it would increase the learning curve for myself and others who work on the project, and the company I work for has been contracted to do this.</p>
  
  <p><strong>Another edit:</strong> I'm not sure if <code>JSP tags</code> will be useful because my content doesn't really have any template variables. What I need is a way to be able to do this:</p>
  
  <p><code>base.html:</code></p>
  
  <pre><code>&lt;html&gt;&lt;body&gt;
  { content.body }
  &lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p><code>somepage.html</code></p>
  
  <pre><code>&lt;wrapper:base.html&gt;
  &lt;h1&gt;Welcome&lt;/h1&gt;
  &lt;/wrapper&gt;
  </code></pre>
  
  <p>with the output being:</p>
  
  <pre><code>&lt;html&gt;&lt;body&gt;
  &lt;h1&gt;Welcome&lt;/h1&gt;
  &lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p>I think this would give me enough versatility to do everything I need. It could be achieved with <code>includes</code> but then I would need a top and a bottom include for each wrapper, which is kind of messy.</p>