title: Displaying HTML code based on condition JSP
body: <p>I am trying to display <code>div</code> based on the availability of data using JSP. My issue is even if when the condition is valid, and the corresponding block responsible for showing the <code>div</code> executes, I am not able to view the said section rendered in my web page.</p>
  
  <pre><code>&lt;body&gt;
       &lt;form&gt;
            &lt;h3&gt;Order Type&lt;/h3&gt;
            &lt;div id="orderType" class="specialOrder"&gt;
              &lt;table&gt;
                  &lt;tr&gt;&lt;td&gt;&lt;label id="numberLabelId" for="numberId"&gt;Number&lt;/label&gt;
                       &lt;input type="text" name="number" id="numberId" onchange="processInput()"/&gt;
                       &lt;input type="hidden" name="groupSize" value="1" id="groupSizeId"/&gt;
                  &lt;/td&gt;&lt;/tr&gt;
              &lt;/table&gt;
            &lt;/div&gt;
              &lt;%
                  boolean dataReceived = false;
                  boolean isQualified = false;
                  String qualificationMessage = "";
                  String error = "";
  
                  if(request.getParameter("json") != null)
                  {
                      System.out.println("Response: " + request.getParameter("json"));
  
                      JSONObject jsonObject = JSONObject.fromObject(request.getParameter("json"));
                      MPQResponse mpqResponse = (MPQResponse) JSONObject.toBean(jsonObject, MPQResponse.class);
  
                      isQualified = mpqResponse.isQualified();
                      qualificationMessage = mpqResponse.isQualified() ? "Number is qulified for porting": "Number is not qualified for porting";
                      error = mpqResponse.getErrorMessage();
                      dataReceived = true;
  
                      System.out.println("Qualification status: " + qualificationMessage);
                      System.out.println("Error: " + error);
                  }
              %&gt;
              &lt;%
                  if(dataReceived &amp;&amp; isQualified)
                  {
              %&gt;
                   &lt;div&gt;&lt;%=qualificationMessage%&gt;/div&gt;
                   &lt;script type="text/javascript" &gt;
                       refreshPage();
                   &lt;/script&gt;
             &lt;%
                  }
                  else
                  {
             %&gt;
                  &lt;div&gt;&lt;%=qualificationMessage%&gt;&lt;/div&gt;
                  &lt;div&gt;&lt;%=error%&gt;&lt;/div&gt;
              &lt;%
                  }
              %&gt;
          &lt;/form&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>The above is part of my code; in the above section, even <code>dataReceived</code> and <code>isQualified</code> is <code>true</code> the <code>div</code> section within this block does not render (I can see the code enters the block with the use of a debugger). What am I doing wring? I tried with JTL <code>&lt;c:if&gt;</code> still the same result.</p>