title: Confusion related with <jsp:include> and <@ include>? Dynamic include and "friendly Containers"
body: <p>There is good discussion on Stack Overflow about their difference found <a href="https://stackoverflow.com/questions/14580120/whats-the-difference-between-including-files-with-jsp-include-directive-jsp-in">here</a>. It roughly says that <code>&lt;jsp:include&gt;</code> is <strong>dynamic</strong>, while <code>&lt;@ include&gt;</code> is <strong>static</strong>. Yet, I have some questions.</p>
  <p><strong>1. st question</strong></p>
  <p>Say I use <code>&lt;jsp include&gt;</code> to include <em>header.jsp</em> file. It would run like this: Container compiles my JSP file and during runtime it calls <em>header.jsp</em>, which would also get compiled. So now it uses its content as a response to my JSP file (and combines it). But how is it dynamic? What happens if I change <em>header.jsp</em>? As it had already been compiled, it won't see any changes. So does <code>&lt;jsp: include page=&quot;header.jsp&quot;/&gt;</code> simply compiles <em>header.jsp</em> <strong>every single time</strong> to maintain its dynamic behavior? Or there is different approach that &quot;tells&quot; Container to recompile it?</p>
  <p><strong>2. nd question</strong></p>
  <p>Whatever the answer on first question, I understand that it is dynamic, no matter how does it do it. Well, until I came across this picture from <em>Head First JSP and Servlets</em>.</p>
  <p><a href="https://i.stack.imgur.com/n3DOd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/n3DOd.png" alt="enter image description here" /></a></p>
  <p>Does this now mean that even <code>&lt;@ include&gt;</code> can be dynamic, as well? If I am making an app in Tomcat5 (friendly container), why would I care if some other Container (older versions) aren't friendly? I mean, I would use one Container and stick to it, not move my app around other Containers, right? So why I don't simply always use <code>&lt;@ include&gt;</code>, let Container &quot;deal&quot; with any changes in included file, plus I don't get performance hit of using <em>RequestDispatcher</em> every single request (like <code>&lt;jsp:include</code> has).</p>