title: How to pass parameter to jsp:include via c:set? What are the scopes of the variables in JSP?
body: <p>I have this on welcome.jsp</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;c:set var="pgTitle" value="Welcome"/&gt;
  &lt;jsp:include page="/jsp/inc/head.jsp" /&gt;
  </code></pre>
  
  <p>And this in head.jsp:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;title&gt;Site Name - ${pgTitle}&lt;/title&gt;
  </code></pre>
  
  <p>But the variable is blank, and the output is merely </p>
  
  <pre><code>Site Name -
  </code></pre>
  
  <p>I have read many articles, and I cannot figure out what the problem is. If I echo <code>${pgTitle}</code> elsewhere within the same welcome.jsp, then it outputs fine.</p>
  
  <p>I am including the core tag library on both pages.</p>