title: How to use <div> properly in Struts 2
body: <p>I have a list in JSP page which is iterated by Struts tag and when I try to create <code>&lt;div&gt;</code> for each iteration it is not working fine.</p>
  <p><strong>Here is my code:</strong></p>
  <pre><code>&lt;div style=&quot;height:300px;width:700px;border:solid 2px white;overflow:scroll;overflow-x:hidden;overflow-y:scroll;&quot;&gt;
  
          &lt;s:if test=&quot;#request.questions !=null &amp;&amp; #request.questions.size()&gt;0&quot;&gt;
            &lt;s:set var=&quot;id&quot;  value=&quot;-1&quot; /&gt;
                 
             &lt;s:iterator value=&quot;#request.questions&quot; status=&quot;index&quot; var=&quot;ques&quot;&gt;
                  
               &lt;s:if test=&quot;%{#id != surveyId}&quot;&gt; 
                 name &lt;s:property value=&quot;surveyId&quot;/&gt;
                  &lt;s:set var=&quot;id&quot;  value=&quot;surveyId&quot;/&gt;
                  &lt;/s:if&gt;
                
                &lt;s:div &quot;  id=&quot;questionNumber&lt;s:property value='sortOrder'/&gt;&quot;&gt;
                      &lt;span class=&quot;questionCode&quot;&gt;&lt;s:property value=&quot;questioncode&quot;/&gt;. &lt;/span&gt; 
                       
                      &lt;span class=&quot;questionText&quot;&gt;&lt;s:property value=&quot;questionname&quot;/&gt; &lt;/span&gt;
                  
                      &lt;s:div class=&quot;answersBlock&quot;&gt;
                          &lt;s:div&gt;&lt;label class=&quot;answerLabel&quot;&gt;Ans. &lt;s:property value=&quot;answername&quot;/&gt; &lt;/label&gt;&lt;/s:div&gt;
                      &lt;/s:div&gt;
                  
                  &lt;/s:div&gt;
                  
                  &lt;/s:iterator&gt;
          &lt;/s:if&gt;
          &lt;s:else&gt;
              No Survey Taken Yet.
          &lt;/s:else&gt;&lt;/p&gt;
  &lt;/div&gt;
  </code></pre>
  <p>Here I am getting date like in below format</p>
  <pre><code>id 281
  q1: question
  ans: -----
  
  id: 282
  q1:question
  ans: ---
  q2: question
  ans:----
  q3:question
  and:----
  </code></pre>
  <p>now what I want here is to create two separate <code>&lt;div&gt;</code> for <code>id</code>s 281, 282, and put content of  each <code>id</code> in a different <code>&lt;div&gt;</code>.</p>
  <p>I am getting data dynamically, so it could be  more then  2 <code>id</code>'s, so on the bases of them create a <code>&lt;div&gt;</code> and one <code>id</code> can have multiple question answer.</p>