title: JSP import with dynamic URL
body: <p>I am in a situation where I am importing a jsp page which in turn imports two other pages based on the parameters of the import.  The problem is that when I try to use the parameters in the URL of the two imports on the page that is imported, it is an invalid URL. But if I hard code the parameters into the URL it loads with no problem.  This is how my code is:</p>
  
  <pre><code>//the following is the first import
  &lt;c:import url="/blahblah/index.jsp"&gt;
      &lt;c:param name="sectionId" value="3" /&gt;
      &lt;c:param name="aPageId" value="5" /&gt;
      &lt;c:param name="bPageId" value="2" /&gt;
  &lt;/c:import&gt;
  
  // the following is (index.jsp) the page that is imported and imports other pages based on the parameters
  
      int sectionId = request.getParameter("sectionId");
      int aPageId = request.getParameter("aPageId");
      int bPageId = request.getParameter("bPageId");
  
      &lt;c:import url="/blahblah/blah.jsp?sectionId=&lt;%=sectionId%&gt;&amp;page_id=&lt;%=aPageId%&gt;" /&gt;
  
      &lt;c:import url="/blahblah/blah.jsp?sectionId=&lt;%=sectionId%&gt;&amp;page_id=&lt;%=bPageId%&gt;" /&gt;
  </code></pre>
  
  <p>Am I outputting the parameters incorrectly? It doesn't work even if I hard code the variables like:</p>
  
  <pre><code>int bPageId = 3;
  </code></pre>
  
  <p>It will only work if I actually write 3 in the c:import like this:</p>
  
  <pre><code>&lt;c:import url="/blahblah/blah.jsp?sectionId=3&amp;page_id=2" /&gt;
  </code></pre>