title: Call a jsp Page in an iframe
body: <p>I am working on an interface using JSP pages and Javascript. My Project Structure is shown here.</p>
  
  <p><a href="https://i.stack.imgur.com/Eetgv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Eetgv.png" alt="project structure"></a></p>
  
  <p>In my main JSP page(<code>veditor.jsp</code>) under views, I have a Properties Panel division. </p>
  
  <p><a href="https://i.stack.imgur.com/PFKp3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PFKp3.png" alt="pic1"></a></p>
  
  <p><strong>veditor.jsp</strong></p>
  
  <pre><code>...
  &lt;!--Container/Canvas--&gt;
  
      &lt;div id="container" class="container"&gt;
      &lt;/div&gt;
  
  &lt;!--Properties Panel--&gt;
  
      &lt;div style="float: left" class="property" id="propertypane"&gt;
          &lt;h1 class="toolbox-titlex" id="toolbox-titlex"&gt;Properties&lt;/h1&gt;
          &lt;iframe class = "panel" id="lot"&gt;&lt;/iframe&gt; 
      &lt;/div&gt;
  ...
  </code></pre>
  
  <p>Here I need to call the <code>selectClauseForm.jsp</code> page within the <code>veditor.jsp</code>'s iframe in the Properties Panel using the <code>veditor.js</code> Javascript.</p>
  
  <p><strong>veditor.js</strong></p>
  
  <pre><code>if (dropElem == "stream ui-draggable") {
      var newAgent = $('&lt;div&gt;').attr('id', i).addClass('streamdrop');
      var elemType = "table";
  
      $("#container").addClass("disabledbutton");
      $("#toolbox").addClass("disabledbutton");
      $('#container').append(newAgent);
  
      callSelectClauseForm();
  }
  
  function callSelectClauseForm()
  {
      alert("Called before");
      document.getElementById("lot").src = 'selectClauseForm.jsp';
      alert("Called after");
  }
  </code></pre>
  
  <p>I am getting both the alerts within the <code>callSelectForm()</code> method but the Properties panel is not loading and am getting the following error.</p>
  
  <p><a href="https://i.stack.imgur.com/mKsof.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mKsof.png" alt="error"></a></p>
  
  <p>As shown above, when calling the <code>createTableForm(...)</code> method, I need to call the <code>selectClauseForm.jsp</code> within the iframe in the <code>veditor.jsp</code>. </p>
  
  <p>Is this because my path is wrong in the <code>src</code> location?
  Any suggestions on how I can load the jsp inside the iframe using Javascript will be highly appreciated as I am new to this.</p>