How to get JSP parameter in dynamically? (or create JSP parameter)
<p>I'm new to JSP and ajax but trying both at the same time.</p>

<p>I'm making a dynamic tab that can be added or removed with these steps.</p>

<p>I wannna put parameter from controller in the newly added tab's content area.</p>

<hr>

<p>1.When a 'Load Project' button from the list is clicked, add a new tab.</p>

<pre class="lang-js prettyprint-override"><code>$('&lt;li role="presentation"&gt;'
    +'&lt;a href="#'+tabId+'" aria-controls="'+tabId+'" role="tab" data-toggle="tab"&gt;'
    +$projectName
    +' &lt;span class="closeTab glyphicon glyphicon-remove" aria-hidden="true"&gt;&lt;/span&gt;'
    +'&lt;input class="hiddenProjectId" type="text" name="projectId" value="'+ pId +'" style="display: none;"&gt;'
    +'&lt;/a&gt;&lt;/li&gt;').insertBefore('#liProjectTabAdd');


$('&lt;div role="tabpanel" class="tab-pane fade" id="'+ tabId + '"&gt;'
                + '&lt;div class="projectContent"&gt;'
                + '&lt;ul class="blockList list-unstyled draggableList"&gt;&lt;/ul&gt;'
                + '&lt;div class="table-hover addBlock"&gt;'
                + 'add block &lt;span id="addBlockGlyp" class="glyphicon glyphicon-plus" aria-hidden="true"&gt;&lt;/span&gt;'
                + '&lt;/div&gt;&lt;/div&gt;'
                + '&lt;/div&gt;').appendTo('.projectTab-content');
</code></pre>

<p>2.call the controller through ajax(post method)</p>

<pre class="lang-js prettyprint-override"><code>$.post("loadProjectContent.do",
    {
        projectId: pId
    }
);
</code></pre>

<p>3.The controller call DAO and get the project's content.
(The contents are correct. I checked it with printing)</p>

<pre class="lang-js prettyprint-override"><code>Project project = new Project();

project.setProjectId(Integer.parseInt(request.getParameter("projectId")));

dao.doGetProjectContent(project);

request.setAttribute("projectContent", project.getProjectContent());
</code></pre>

<hr>

<p><strong>Then now, how to get this projectContent in JSP?</strong></p>

<p>I've tried adding jsp tag when I append the tab, but it was a raw text. </p>

<p>(like ~~~${ projectContent }~~~)</p>

<pre class="lang-js prettyprint-override"><code>$('&lt;div role="tabpanel" class="tab-pane fade" id="'+ tabId + '"&gt;'
    + '&lt;div class="projectContent"&gt;'
    + '&lt;ul class="blockList list-unstyled draggableList"&gt;'
    + '${ projectContent }'
    + '&lt;/ul&gt;'
    + '&lt;div class="table-hover addBlock"&gt;'
    + 'add block &lt;span id="addBlockGlyp" class="glyphicon glyphicon-plus" aria-hidden="true"&gt;&lt;/span&gt;'
    + '&lt;/div&gt;&lt;/div&gt;'
    + '&lt;/div&gt;').appendTo('.projectTab-content');
</code></pre>

<hr>

<p>Please save this newbie</p>