title: How to include an html fragment in a jsp that loads at run-time?
body: <p>I need to include content in a JSP <strong>without using</strong> the include directive.</p>
  
  <p>It is easy to do a server-side include with with <code>&lt;%@include file="includeMe.htm" %&gt;</code> but the content of <code>includeMe.htm</code> gets added to the JSP <strong>before</strong> the JSP is converted into a Servlet by the container. This means that if includeMe.htm gets modified, the changes are not reflected in the generated <code>.java</code> Servlet file. I'm tired of going into Tomcats generated files directory to manually delete the generated java and class files or re-deploy my app every time the included file changes.</p>
  
  <p>Do I need to write a code block to just read in data from the text file line by line and then write it like this?</p>
  
  <pre><code> &lt;%
      while( not done reading from file ) {
          String line = scanner.nextLine();
          response.getWriter().println(line);
      }  %&gt;
  </code></pre>
  
  <p>Is there an easier or cleaner way?</p>